@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.
    SecurityRoleFunctionKeys securityRoleFunctionKeys =
        new SecurityRoleFunctionKeys(Collections.singletonList(new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION)));
    // Mock the external calls.
    when(securityRoleFunctionService.getSecurityRoleFunctionsBySecurityRole(securityRoleKey)).thenReturn(securityRoleFunctionKeys);
    // Call the method under test.
    SecurityRoleFunctionKeys result = securityRoleFunctionRestController.getSecurityRoleFunctionsBySecurityRole(SECURITY_ROLE);
    // Validate the response.
    assertEquals(securityRoleFunctionKeys, result);
    // Verify the external calls.
    verify(securityRoleFunctionService).getSecurityRoleFunctionsBySecurityRole(securityRoleKey);
    verifyNoMoreInteractions(securityRoleFunctionService);
}