@Test
public void testCreateSecurityFunction() throws Exception
{

    SecurityFunctionCreateRequest securityFunctionCreateRequest = new SecurityFunctionCreateRequest(SECURITY_FUNCTION);
    // Create a security function.
    SecurityFunction securityFunction = new SecurityFunction(SECURITY_FUNCTION);
    when(securityFunctionService.createSecurityFunction(securityFunctionCreateRequest)).thenReturn(securityFunction);
    SecurityFunction resultSecurityFunction = securityFunctionRestController.createSecurityFunction(new SecurityFunctionCreateRequest(SECURITY_FUNCTION));
    // Validate the returned object.
    assertEquals(new SecurityFunction(SECURITY_FUNCTION), resultSecurityFunction);
    // Verify the external calls.
    verify(securityFunctionService).createSecurityFunction(securityFunctionCreateRequest);
    verifyNoMoreInteractions(securityFunctionService);
    // Validate the returned object.
    assertEquals(securityFunction, resultSecurityFunction);
}