DualAnnotationService extends DefaultService implements AnnotationStorageService { protected boolean isQueryHavingEpochCutOff(AnnotationQuery query){ return query.getStartTimestamp() < annotationTransitionEpochMs && query.getEndTimestamp() >= annotationTransitionEpochMs; } @Inject protected  DualAnnotationService(SystemConfiguration config,
            @NamedBinding AnnotationStorageService elasticSearchAnnotationService,
            TSDBService tsdbService); @Override void dispose(); @Override void putAnnotations(List<Annotation> annotations); @Override List<Annotation> getAnnotations(List<AnnotationQuery> queries);  }
@Test public void testQueryBeforeEpochCutOffTimestamp(){ AnnotationQuery annotationQuery = new AnnotationQuery("scope1", "metric1", null, "unittest", 1559596094000L, 1559596095000L); assertFalse(dualAnnotationService.isQueryHavingEpochCutOff(annotationQuery)); }
@Test public void testQueryAfterEpochCutOffTimestamp(){ AnnotationQuery annotationQuery = new AnnotationQuery("scope1", "metric1", null, "unittest", 1559594094000L, 1559594095000L); assertFalse(dualAnnotationService.isQueryHavingEpochCutOff(annotationQuery)); }
@Test public void testQueryAcrossEpochCutOffTimestamp(){ AnnotationQuery annotationQuery = new AnnotationQuery("scope1", "metric1", null, "unittest", 1559153223000L, 1559153226000L); assertTrue(dualAnnotationService.isQueryHavingEpochCutOff(annotationQuery)); }