@Test
public void testCreateMetaFactType() throws Exception {

  CreateFactTypeRequest request = createMetaFactTypeRequest();
  FactTypeEntity newEntity = new FactTypeEntity();
  when(factManager.saveFactType(any())).thenReturn(newEntity);
  delegate.handle(request);
  verify(factTypeHelper).assertFactTypeNotExists(request.getName());
  verify(factTypeHelper).assertFactTypesToBindExist(request.getRelevantFactBindings(), "relevantFactBindings");
  verify(factTypeHelper).convertMetaFactBindingDefinitions(request.getRelevantFactBindings());
  verify(factTypeResponseConverter).apply(newEntity);
  verify(factManager).saveFactType(argThat(entity -> {
    assertCommonEntity(request, entity);
    assertEquals(1, entity.getRelevantFactBindings().size());
    return true;
  }));
}