SemanticMetadataBackendReporter implements MetadataBackendReporter { @Override public MetadataBackend decorate( final MetadataBackend backend ) { return new InstrumentedMetadataBackend(backend); } SemanticMetadataBackendReporter(SemanticMetricRegistry registry); @Override MetadataBackend decorate(
        final MetadataBackend backend
    ); @Override FutureReporter.Context setupBackendWriteReporter(); @Override void reportWriteDroppedByCacheHit(); @Override void failedShards(final long errors); @Override void reportWriteDroppedByDuplicate(); String toString();  }
@Test public void testDecorated() { final SemanticMetricRegistry registry = mock(SemanticMetricRegistry.class); final SemanticMetadataBackendReporter reporter = new SemanticMetadataBackendReporter(registry); final MetadataBackend backend = mock(MetadataBackend.class); final MetadataBackend decorated = reporter.decorate(backend); { final AsyncObservable<FindSeriesIdsStream> response = mock(AsyncObservable.class); final FindSeries.Request request = mock(FindSeries.Request.class); doReturn(response).when(backend).findSeriesIdsStream(request); assertEquals(response, decorated.findSeriesIdsStream(request)); verify(backend).findSeriesIdsStream(request); } { final AsyncObservable<FindSeriesStream> response = mock(AsyncObservable.class); final FindSeries.Request request = mock(FindSeries.Request.class); doReturn(response).when(backend).findSeriesStream(request); assertEquals(response, decorated.findSeriesStream(request)); verify(backend).findSeriesStream(request); } { final Statistics statistics = mock(Statistics.class); doReturn(statistics).when(backend).getStatistics(); assertEquals(statistics, decorated.getStatistics()); verify(backend).getStatistics(); } }