@Test public void testBuildCanaryScope_WithDayGranularity() { CanaryScope canaryScope = new CanaryScope( "scope", "location", Instant.now(), Instant.now(), WavefrontCanaryScopeFactory.DAY, null); CanaryScope generatedCanaryScope = queryBuilder.buildCanaryScope(canaryScope); WavefrontCanaryScope wavefrontCanaryScope = (WavefrontCanaryScope) generatedCanaryScope; assertThat(wavefrontCanaryScope.getGranularity(), is("d")); }
@Override public CanaryScope buildCanaryScope(CanaryScope scope) { WavefrontCanaryScope wavefrontCanaryScope = new WavefrontCanaryScope(); wavefrontCanaryScope.setScope(scope.getScope()); wavefrontCanaryScope.setLocation(scope.getLocation()); wavefrontCanaryScope.setStart(scope.getStart()); wavefrontCanaryScope.setEnd(scope.getEnd()); wavefrontCanaryScope.setStep(scope.getStep()); wavefrontCanaryScope.setGranularity(generateGranularity(scope.getStep())); wavefrontCanaryScope.setExtendedScopeParams(scope.getExtendedScopeParams()); return wavefrontCanaryScope; }
WavefrontCanaryScopeFactory implements CanaryScopeFactory { @Override public CanaryScope buildCanaryScope(CanaryScope scope) { WavefrontCanaryScope wavefrontCanaryScope = new WavefrontCanaryScope(); wavefrontCanaryScope.setScope(scope.getScope()); wavefrontCanaryScope.setLocation(scope.getLocation()); wavefrontCanaryScope.setStart(scope.getStart()); wavefrontCanaryScope.setEnd(scope.getEnd()); wavefrontCanaryScope.setStep(scope.getStep()); wavefrontCanaryScope.setGranularity(generateGranularity(scope.getStep())); wavefrontCanaryScope.setExtendedScopeParams(scope.getExtendedScopeParams()); return wavefrontCanaryScope; } }
WavefrontCanaryScopeFactory implements CanaryScopeFactory { @Override public CanaryScope buildCanaryScope(CanaryScope scope) { WavefrontCanaryScope wavefrontCanaryScope = new WavefrontCanaryScope(); wavefrontCanaryScope.setScope(scope.getScope()); wavefrontCanaryScope.setLocation(scope.getLocation()); wavefrontCanaryScope.setStart(scope.getStart()); wavefrontCanaryScope.setEnd(scope.getEnd()); wavefrontCanaryScope.setStep(scope.getStep()); wavefrontCanaryScope.setGranularity(generateGranularity(scope.getStep())); wavefrontCanaryScope.setExtendedScopeParams(scope.getExtendedScopeParams()); return wavefrontCanaryScope; }  }
WavefrontCanaryScopeFactory implements CanaryScopeFactory { @Override public CanaryScope buildCanaryScope(CanaryScope scope) { WavefrontCanaryScope wavefrontCanaryScope = new WavefrontCanaryScope(); wavefrontCanaryScope.setScope(scope.getScope()); wavefrontCanaryScope.setLocation(scope.getLocation()); wavefrontCanaryScope.setStart(scope.getStart()); wavefrontCanaryScope.setEnd(scope.getEnd()); wavefrontCanaryScope.setStep(scope.getStep()); wavefrontCanaryScope.setGranularity(generateGranularity(scope.getStep())); wavefrontCanaryScope.setExtendedScopeParams(scope.getExtendedScopeParams()); return wavefrontCanaryScope; }  @Override boolean handles(String serviceType); @Override CanaryScope buildCanaryScope(CanaryScope scope); }
WavefrontCanaryScopeFactory implements CanaryScopeFactory { @Override public CanaryScope buildCanaryScope(CanaryScope scope) { WavefrontCanaryScope wavefrontCanaryScope = new WavefrontCanaryScope(); wavefrontCanaryScope.setScope(scope.getScope()); wavefrontCanaryScope.setLocation(scope.getLocation()); wavefrontCanaryScope.setStart(scope.getStart()); wavefrontCanaryScope.setEnd(scope.getEnd()); wavefrontCanaryScope.setStep(scope.getStep()); wavefrontCanaryScope.setGranularity(generateGranularity(scope.getStep())); wavefrontCanaryScope.setExtendedScopeParams(scope.getExtendedScopeParams()); return wavefrontCanaryScope; }  @Override boolean handles(String serviceType); @Override CanaryScope buildCanaryScope(CanaryScope scope); static long SECOND; static long MINUTE; static long HOUR; static long DAY; }