SecurityRoleFunctionServiceImpl implements SecurityRoleFunctionService { @Override public SecurityRoleFunctionKeys getSecurityRoleFunctionsBySecurityFunction(SecurityFunctionKey securityFunctionKey) { securityFunctionHelper.validateAndTrimSecurityFunctionKey(securityFunctionKey); SecurityRoleFunctionKeys securityRoleFunctionKeys = new SecurityRoleFunctionKeys(); securityRoleFunctionKeys.getSecurityRoleFunctionKeys() .addAll(securityRoleFunctionDao.getSecurityRoleFunctionKeysBySecurityFunction(securityFunctionKey.getSecurityFunctionName())); return securityRoleFunctionKeys; }  @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 testGetSecurityRoleFunctionsBySecurityFunction() { SecurityFunctionKey securityFunctionKey = new SecurityFunctionKey(SECURITY_FUNCTION); List<SecurityRoleFunctionKey> securityRoleFunctionKeys = Collections.singletonList(new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION)); when(securityRoleFunctionDao.getSecurityRoleFunctionKeysBySecurityFunction(SECURITY_FUNCTION)).thenReturn(securityRoleFunctionKeys); SecurityRoleFunctionKeys result = securityRoleFunctionService.getSecurityRoleFunctionsBySecurityFunction(securityFunctionKey); assertEquals(new SecurityRoleFunctionKeys(securityRoleFunctionKeys), result); verify(securityFunctionHelper).validateAndTrimSecurityFunctionKey(securityFunctionKey); verify(securityRoleFunctionDao).getSecurityRoleFunctionKeysBySecurityFunction(SECURITY_FUNCTION); verifyNoMoreInteractionsHelper(); }