DbExchangeMaster extends AbstractDocumentDbMaster<ExchangeDocument> implements ExchangeMaster { @Override public ExchangeDocument get(final UniqueId uniqueId) { return doGet(uniqueId, new ExchangeDocumentExtractor(), "Exchange"); } DbExchangeMaster(final DbConnector dbConnector); @Override ExchangeSearchResult search(final ExchangeSearchRequest request); @Override ExchangeDocument get(final UniqueId uniqueId); @Override ExchangeDocument get(final ObjectIdentifiable objectId, final VersionCorrection versionCorrection); @Override ExchangeHistoryResult history(final ExchangeHistoryRequest request); ExchangeHistoryResult historyByVersionsCorrections(AbstractHistoryRequest request); static final String IDENTIFIER_SCHEME_DEFAULT; }
@Test public void test_example() throws Exception { ManageableExchange exchange = new ManageableExchange(); exchange.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("A", "B"), ExternalId.of("C", "D"))); exchange.setName("Test"); exchange.setRegionIdBundle(ExternalIdBundle.of(ExternalId.of("E", "F"), ExternalId.of("G", "H"))); exchange.setTimeZone(ZoneId.of("Europe/London")); ExchangeDocument addDoc = new ExchangeDocument(exchange); ExchangeDocument added = _exgMaster.add(addDoc); ExchangeDocument loaded = _exgMaster.get(added.getUniqueId()); assertEquals(added, loaded); }