@Test
public void testUpdateFactTypeWithObjectBindingsSuccess() throws Exception {

  UpdateFactTypeRequest request = new UpdateFactTypeRequest()
          .setId(UUID.randomUUID())
          .addAddObjectBinding(new FactObjectBindingDefinition());
  FactTypeEntity existingEntity = new FactTypeEntity();
  when(factTypeRequestResolver.fetchExistingFactType(request.getId())).thenReturn(existingEntity);
  delegate.handle(request);
  verify(factTypeHelper).assertObjectTypesToBindExist(request.getAddObjectBindings(), "addObjectBindings");
  verify(factTypeHelper).convertFactObjectBindingDefinitions(request.getAddObjectBindings());
  verify(factTypeResponseConverter).apply(existingEntity);
  verify(factManager).saveFactType(argThat(entity -> {
    assertSame(existingEntity, entity);
    assertEquals(1, entity.getRelevantObjectBindings().size());
    return true;
  }));
}