SecurityRoleFunctionServiceImpl implements SecurityRoleFunctionService { @Override public SecurityRoleFunction getSecurityRoleFunction(SecurityRoleFunctionKey securityRoleFunctionKey) { securityRoleFunctionHelper.validateAndTrimSecurityRoleFunctionKey(securityRoleFunctionKey); SecurityRoleFunctionEntity securityRoleFunctionEntity = securityRoleFunctionDaoHelper.getSecurityRoleFunctionEntity(securityRoleFunctionKey); return createSecurityRoleFunctionFromEntity(securityRoleFunctionEntity); }  @Override SecurityRoleFunction createSecurityRoleFunction(SecurityRoleFunctionCreateRequest securityRoleFunctionCreateRequest); @Override SecurityRoleFunction deleteSecurityRoleFunction(SecurityRoleFunctionKey securityRoleFunctionKey); @Override SecurityRoleFunction getSecurityRoleFunction(SecurityRoleFunctionKey securityRoleFunctionKey); @Override SecurityRoleFunctionKeys getSecurityRoleFunctions(); @Override SecurityRoleFunctionKeys getSecurityRoleFunctionsBySecurityFunction(SecurityFunctionKey securityFunctionKey); @Override SecurityRoleFunctionKeys getSecurityRoleFunctionsBySecurityRole(SecurityRoleKey securityRoleKey);  }
@Test public void testGetSecurityRoleFunction() { SecurityRoleFunctionKey securityRoleFunctionKey = new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION); SecurityRoleEntity securityRoleEntity = new SecurityRoleEntity(); securityRoleEntity.setCode(SECURITY_ROLE); SecurityFunctionEntity securityFunctionEntity = new SecurityFunctionEntity(); securityFunctionEntity.setCode(SECURITY_FUNCTION); SecurityRoleFunctionEntity securityRoleFunctionEntity = new SecurityRoleFunctionEntity(); securityRoleFunctionEntity.setId(ID); securityRoleFunctionEntity.setSecurityRole(securityRoleEntity); securityRoleFunctionEntity.setSecurityFunction(securityFunctionEntity); when(securityRoleFunctionDaoHelper.getSecurityRoleFunctionEntity(securityRoleFunctionKey)).thenReturn(securityRoleFunctionEntity); SecurityRoleFunction result = securityRoleFunctionService.getSecurityRoleFunction(securityRoleFunctionKey); assertEquals(new SecurityRoleFunction(ID, securityRoleFunctionKey), result); verify(securityRoleFunctionHelper).validateAndTrimSecurityRoleFunctionKey(securityRoleFunctionKey); verify(securityRoleFunctionDaoHelper).getSecurityRoleFunctionEntity(securityRoleFunctionKey); verifyNoMoreInteractionsHelper(); }