@Test
public void testStoreFactSavesEntity() {

  FactRecord record = new FactRecord().setId(UUID.randomUUID());
  FactEntity entity = new FactEntity().setId(record.getId());
  FactDocument document = new FactDocument().setId(record.getId());
  when(factRecordConverter.toEntity(record)).thenReturn(entity);
  when(factRecordConverter.toDocument(record)).thenReturn(document);
  assertSame(record, dao.storeFact(record));
  verify(factManager).saveFact(entity);
  verify(factSearchManager).indexFact(document);
  verify(factRecordConverter).toEntity(argThat(r -> r.getId() == record.getId()));
  verify(factRecordConverter).toDocument(argThat(r -> r.getId() == record.getId()));
}