@Test
public void testStoreFactSetsId() {

  FactRecord record = new FactRecord();
  FactEntity entity = new FactEntity();
  FactDocument document = new FactDocument();
  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() != null));
  verify(factRecordConverter).toDocument(argThat(r -> r.getId() != null));
}