CompositeMarketDataSnapshot implements MarketDataSnapshot { @Override public void init() { for (final MarketDataSnapshot snapshot : _snapshots) { snapshot.init(); } } CompositeMarketDataSnapshot(final List<MarketDataSnapshot> snapshots, final SnapshottingViewExecutionDataProvider.ValueSpecificationProvider valueMap); @Override UniqueId getUniqueId(); @Override Instant getSnapshotTimeIndication(); @Override void init(); @Override void init(final Set<ValueSpecification> values, final long timeout, final TimeUnit unit); @Override boolean isInitialized(); @Override boolean isEmpty(); @Override Instant getSnapshotTime(); @Override Object query(final ValueSpecification value); @Override Map<ValueSpecification, Object> query(final Set<ValueSpecification> values);  }
@Test public void init() { _snapshot.init(); verify(_delegate1).init(); verify(_delegate2).init(); }
@SuppressWarnings("unchecked") @Test public void initMultiSubset() { final Set<ValueSpecification> specs = Sets.newHashSet(SPECIFICATION1_EXT, UNKNOWN_SPECIFICATION); _snapshot.init(specs, 0, TimeUnit.MILLISECONDS); verify(_delegate1).init(Sets.newHashSet(SPECIFICATION1), 0, TimeUnit.MILLISECONDS); verify(_delegate1, never()).init(); verify(_delegate2).init(); verify(_delegate2, never()).init(anySet(), anyLong(), (TimeUnit) anyObject()); }
@Test public void initMultiAll() { final Set<ValueSpecification> specs = Sets.newHashSet(SPECIFICATION1_EXT, SPECIFICATION2_EXT, UNKNOWN_SPECIFICATION); _snapshot.init(specs, 0, TimeUnit.MILLISECONDS); verify(_delegate1).init(Sets.newHashSet(SPECIFICATION1), 0, TimeUnit.MILLISECONDS); verify(_delegate2).init(Sets.newHashSet(SPECIFICATION2), 0, TimeUnit.MILLISECONDS); }