@Test
public void testCreateSecurityFunctionAlreadyExists()
{

    expectedException.expect(AlreadyExistsException.class);
    expectedException.expectMessage(String.format("Unable to create security function \"%s\" because it already exists.", SECURITY_FUNCTION));
    when(securityFunctionDao.getSecurityFunctionByName(SECURITY_FUNCTION)).thenReturn(SECURITY_FUNCTION_ENTITY);
    when(alternateKeyHelper.validateStringParameter(anyString(), anyString())).thenReturn(SECURITY_FUNCTION);
    securityFunctionService.createSecurityFunction(SECURITY_FUNCTION_CREATE_REQUEST);
}