@Test
public void test_correct_getUpdateGet() {
Instant now = Instant.now(_exgMaster.getClock());
UniqueId uniqueId = UniqueId.of("DbExg", "101", "0");
ExchangeDocument base = _exgMaster.get(uniqueId);
ManageableExchange exchange = new ManageableExchange(BUNDLE, "Test", REGION, null);
exchange.setUniqueId(uniqueId);
ExchangeDocument input = new ExchangeDocument(exchange);
ExchangeDocument corrected = _exgMaster.correct(input);
assertEquals(false, base.getUniqueId().equals(corrected.getUniqueId()));
assertEquals(base.getVersionFromInstant(), corrected.getVersionFromInstant());
assertEquals(base.getVersionToInstant(), corrected.getVersionToInstant());
assertEquals(now, corrected.getCorrectionFromInstant());
assertEquals(null, corrected.getCorrectionToInstant());
assertEquals(input.getExchange(), corrected.getExchange());
ExchangeDocument old = _exgMaster.get(UniqueId.of("DbExg", "101", "0"));
assertEquals(base.getUniqueId(), old.getUniqueId());
assertEquals(base.getVersionFromInstant(), old.getVersionFromInstant());
assertEquals(base.getVersionToInstant(), old.getVersionToInstant());
assertEquals(base.getCorrectionFromInstant(), old.getCorrectionFromInstant());
assertEquals(now, old.getCorrectionToInstant()); // old version ended
assertEquals(base.getExchange(), old.getExchange());
ExchangeHistoryRequest search = new ExchangeHistoryRequest(base.getUniqueId(), now, null);
ExchangeHistoryResult searchResult = _exgMaster.history(search);
assertEquals(2, searchResult.getDocuments().size());
}