@Test
public void testCreateSecurityFunction()
{

    when(securityFunctionDao.getSecurityFunctionByName(SECURITY_FUNCTION)).thenReturn(null);
    when(alternateKeyHelper.validateStringParameter(anyString(), anyString())).thenReturn(SECURITY_FUNCTION);
    when(securityFunctionDao.saveAndRefresh(any(SecurityFunctionEntity.class))).thenReturn(SECURITY_FUNCTION_ENTITY);
    SecurityFunction securityFunction = securityFunctionService.createSecurityFunction(SECURITY_FUNCTION_CREATE_REQUEST);
    assertEquals(SECURITY_FUNCTION, securityFunction.getSecurityFunctionName());
    verify(alternateKeyHelper).validateStringParameter("security function name", SECURITY_FUNCTION);
    verify(securityFunctionDao).getSecurityFunctionByName(SECURITY_FUNCTION);
    verify(securityFunctionDao).saveAndRefresh(any(SecurityFunctionEntity.class));
    verifyNoMoreInteractionsHelper();
}