@Test public void getTSDRMetricRecords() throws Exception { long start = 0L; long end = 0L; int size = 1000; String key = DataCategory.EXTERNAL.name(); ElasticSearchStore.RecordType type = ElasticSearchStore.RecordType.METRIC; service.getTSDRMetricRecords(key, start, end); Mockito.verify(store, Mockito.only()).search(type, key, start, end, size); Mockito.doThrow(IllegalStateException.class).when(store).search( Mockito.any(ElasticSearchStore.RecordType.class), Mockito.anyString(), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyInt()); service.getTSDRMetricRecords(key, start, end); }
@Override public List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end) { return getTSDRRecords(RecordType.METRIC, key, start, end); }
TsdrElasticSearchPersistenceServiceImpl implements TSDRMetricPersistenceService, TSDRLogPersistenceService,
        TSDRBinaryPersistenceService { @Override public List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end) { return getTSDRRecords(RecordType.METRIC, key, start, end); } }
TsdrElasticSearchPersistenceServiceImpl implements TSDRMetricPersistenceService, TSDRLogPersistenceService,
        TSDRBinaryPersistenceService { @Override public List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end) { return getTSDRRecords(RecordType.METRIC, key, start, end); } @Inject  TsdrElasticSearchPersistenceServiceImpl(ElasticSearchStore store); }
TsdrElasticSearchPersistenceServiceImpl implements TSDRMetricPersistenceService, TSDRLogPersistenceService,
        TSDRBinaryPersistenceService { @Override public List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end) { return getTSDRRecords(RecordType.METRIC, key, start, end); } @Inject  TsdrElasticSearchPersistenceServiceImpl(ElasticSearchStore store); @Override void storeMetric(TSDRMetricRecord metricRecord); @Override void storeMetric(List<TSDRMetricRecord> recordList); @Override List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end); @Override void storeLog(TSDRLogRecord logRecord); @Override void storeLog(List<TSDRLogRecord> recordList); @Override List<TSDRLogRecord> getTSDRLogRecords(String key, long start, long end); @Override void storeBinary(TSDRBinaryRecord binaryRecord); @Override void storeBinary(List<TSDRBinaryRecord> recordList); @Override List<TSDRBinaryRecord> getTSDRBinaryRecords(String key, long start, long end); @Override void purge(long timestamp); @Override void purge(DataCategory category, long timestamp); }
TsdrElasticSearchPersistenceServiceImpl implements TSDRMetricPersistenceService, TSDRLogPersistenceService,
        TSDRBinaryPersistenceService { @Override public List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end) { return getTSDRRecords(RecordType.METRIC, key, start, end); } @Inject  TsdrElasticSearchPersistenceServiceImpl(ElasticSearchStore store); @Override void storeMetric(TSDRMetricRecord metricRecord); @Override void storeMetric(List<TSDRMetricRecord> recordList); @Override List<TSDRMetricRecord> getTSDRMetricRecords(String key, long start, long end); @Override void storeLog(TSDRLogRecord logRecord); @Override void storeLog(List<TSDRLogRecord> recordList); @Override List<TSDRLogRecord> getTSDRLogRecords(String key, long start, long end); @Override void storeBinary(TSDRBinaryRecord binaryRecord); @Override void storeBinary(List<TSDRBinaryRecord> recordList); @Override List<TSDRBinaryRecord> getTSDRBinaryRecords(String key, long start, long end); @Override void purge(long timestamp); @Override void purge(DataCategory category, long timestamp);  }