@Test
public void testGetSecurityRoleFunctionEntitySecurityRoleFunctionNoExists()
{

    // Create a security role to function mapping key.
    SecurityRoleFunctionKey securityRoleFunctionKey = new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION);
    // Mock the external calls.
    when(securityRoleFunctionDao.getSecurityRoleFunctionByKey(securityRoleFunctionKey)).thenReturn(null);
    // Specify the expected exception.
    expectedException.expect(ObjectNotFoundException.class);
    expectedException.expectMessage(String
        .format("Security role to function mapping with \"%s\" security role name and \"%s\" security function name doesn't exist.", SECURITY_ROLE,
            SECURITY_FUNCTION));
    // Call the method under test.
    securityRoleFunctionDaoHelper.getSecurityRoleFunctionEntity(securityRoleFunctionKey);
    // Verify the external calls.
    verify(securityRoleFunctionDao).getSecurityRoleFunctionByKey(securityRoleFunctionKey);
    verifyNoMoreInteractionsHelper();
}