@Test
public void testUpdateFactTypeWithFactBindingsSuccess() throws Exception {

  UpdateFactTypeRequest request = new UpdateFactTypeRequest()
          .setId(UUID.randomUUID())
          .addAddFactBinding(new MetaFactBindingDefinition());
  FactTypeEntity existingEntity = new FactTypeEntity();
  when(factTypeRequestResolver.fetchExistingFactType(request.getId())).thenReturn(existingEntity);
  delegate.handle(request);
  verify(factTypeHelper).assertFactTypesToBindExist(request.getAddFactBindings(), "addFactBindings");
  verify(factTypeHelper).convertMetaFactBindingDefinitions(request.getAddFactBindings());
  verify(factTypeResponseConverter).apply(existingEntity);
  verify(factManager).saveFactType(argThat(entity -> {
    assertSame(existingEntity, entity);
    assertEquals(1, entity.getRelevantFactBindings().size());
    return true;
  }));
}