@Test
public void testGetSecurityRoleFunctionsBySecurityRole()
{

    // Create a security role key.
    SecurityRoleKey securityRoleKey = new SecurityRoleKey(SECURITY_ROLE);
    // Create a list of security role to function mapping keys.
    List<SecurityRoleFunctionKey> securityRoleFunctionKeys = Collections.singletonList(new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION));
    // Mock the external calls.
    when(securityRoleFunctionDao.getSecurityRoleFunctionKeysBySecurityRole(SECURITY_ROLE)).thenReturn(securityRoleFunctionKeys);
    // Call the method under test.
    SecurityRoleFunctionKeys result = securityRoleFunctionService.getSecurityRoleFunctionsBySecurityRole(securityRoleKey);
    // Validate the results.
    assertEquals(new SecurityRoleFunctionKeys(securityRoleFunctionKeys), result);
    // Verify the external calls.
    verify(securityRoleHelper).validateAndTrimSecurityRoleKey(securityRoleKey);
    verify(securityRoleFunctionDao).getSecurityRoleFunctionKeysBySecurityRole(SECURITY_ROLE);
    verifyNoMoreInteractionsHelper();
}