@Test public void testIfFilledAndNotMetrics() throws Exception { assertTrue(MetricsInstrumentationInterceptor.isFilledAndNotMetrics("foobar")); assertTrue(MetricsInstrumentationInterceptor.isFilledAndNotMetrics("rainbow")); assertFalse(MetricsInstrumentationInterceptor.isFilledAndNotMetrics("_metrics")); assertFalse(MetricsInstrumentationInterceptor.isFilledAndNotMetrics("")); assertFalse(MetricsInstrumentationInterceptor.isFilledAndNotMetrics(" ")); assertFalse(MetricsInstrumentationInterceptor.isFilledAndNotMetrics(null)); }
@VisibleForTesting static boolean isFilledAndNotMetrics(String dbOrCollectionName) { return dbOrCollectionName != null && !dbOrCollectionName.trim().isEmpty() && !dbOrCollectionName.equalsIgnoreCase(_METRICS); }
MetricsInstrumentationInterceptor implements MongoInterceptor { @VisibleForTesting static boolean isFilledAndNotMetrics(String dbOrCollectionName) { return dbOrCollectionName != null && !dbOrCollectionName.trim().isEmpty() && !dbOrCollectionName.equalsIgnoreCase(_METRICS); } }
MetricsInstrumentationInterceptor implements MongoInterceptor { @VisibleForTesting static boolean isFilledAndNotMetrics(String dbOrCollectionName) { return dbOrCollectionName != null && !dbOrCollectionName.trim().isEmpty() && !dbOrCollectionName.equalsIgnoreCase(_METRICS); }  }
MetricsInstrumentationInterceptor implements MongoInterceptor { @VisibleForTesting static boolean isFilledAndNotMetrics(String dbOrCollectionName) { return dbOrCollectionName != null && !dbOrCollectionName.trim().isEmpty() && !dbOrCollectionName.equalsIgnoreCase(_METRICS); }  @Override void handle(MongoRequest request, MongoResponse response); @Override boolean resolve(MongoRequest request, MongoResponse response); }
MetricsInstrumentationInterceptor implements MongoInterceptor { @VisibleForTesting static boolean isFilledAndNotMetrics(String dbOrCollectionName) { return dbOrCollectionName != null && !dbOrCollectionName.trim().isEmpty() && !dbOrCollectionName.equalsIgnoreCase(_METRICS); }  @Override void handle(MongoRequest request, MongoResponse response); @Override boolean resolve(MongoRequest request, MongoResponse response);  }