@Test
public void testGetSecurityRoleFunctionsBySecurityFunction()
{

    // Create a security function key.
    SecurityFunctionKey securityFunctionKey = new SecurityFunctionKey(SECURITY_FUNCTION);
    // 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.getSecurityRoleFunctionKeysBySecurityFunction(SECURITY_FUNCTION)).thenReturn(securityRoleFunctionKeys);
    // Call the method under test.
    SecurityRoleFunctionKeys result = securityRoleFunctionService.getSecurityRoleFunctionsBySecurityFunction(securityFunctionKey);
    // Validate the results.
    assertEquals(new SecurityRoleFunctionKeys(securityRoleFunctionKeys), result);
    // Verify the external calls.
    verify(securityFunctionHelper).validateAndTrimSecurityFunctionKey(securityFunctionKey);
    verify(securityRoleFunctionDao).getSecurityRoleFunctionKeysBySecurityFunction(SECURITY_FUNCTION);
    verifyNoMoreInteractionsHelper();
}