SecurityRoleFunctionServiceImpl implements SecurityRoleFunctionService { @Override public SecurityRoleFunctionKeys getSecurityRoleFunctionsBySecurityRole(SecurityRoleKey securityRoleKey) { securityRoleHelper.validateAndTrimSecurityRoleKey(securityRoleKey); SecurityRoleFunctionKeys securityRoleFunctionKeys = new SecurityRoleFunctionKeys(); securityRoleFunctionKeys.getSecurityRoleFunctionKeys() .addAll(securityRoleFunctionDao.getSecurityRoleFunctionKeysBySecurityRole(securityRoleKey.getSecurityRoleName())); 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 testGetSecurityRoleFunctionsBySecurityRole() { SecurityRoleKey securityRoleKey = new SecurityRoleKey(SECURITY_ROLE); List<SecurityRoleFunctionKey> securityRoleFunctionKeys = Collections.singletonList(new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION)); when(securityRoleFunctionDao.getSecurityRoleFunctionKeysBySecurityRole(SECURITY_ROLE)).thenReturn(securityRoleFunctionKeys); SecurityRoleFunctionKeys result = securityRoleFunctionService.getSecurityRoleFunctionsBySecurityRole(securityRoleKey); assertEquals(new SecurityRoleFunctionKeys(securityRoleFunctionKeys), result); verify(securityRoleHelper).validateAndTrimSecurityRoleKey(securityRoleKey); verify(securityRoleFunctionDao).getSecurityRoleFunctionKeysBySecurityRole(SECURITY_ROLE); verifyNoMoreInteractionsHelper(); }