@Test public void testBuildDetector() { val factoryUnderTest = new ConstantThresholdDetectorFactoryProvider(); val document = readDocument("constant-threshold"); val detector = factoryUnderTest.buildDetector(document); val params = detector.getParams(); val thresholds = params.getThresholds(); assertNotNull(detector); assertSame(ConstantThresholdDetector.class, detector.getClass()); assertEquals("e2e290a0-d1c1-471e-9d72-79d43282cfbd", detector.getUuid().toString()); assertEquals(AnomalyType.RIGHT_TAILED, params.getType()); assertEquals(16666.0, thresholds.getUpperStrong(), TOLERANCE); assertEquals(2161.0, thresholds.getUpperWeak(), TOLERANCE); }
@Override public ConstantThresholdDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val params = parseParams(document); return new ConstantThresholdDetector(document.getUuid(), params, document.isTrusted()); }
ConstantThresholdDetectorFactoryProvider implements DetectorFactoryProvider<ConstantThresholdDetector> { @Override public ConstantThresholdDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val params = parseParams(document); return new ConstantThresholdDetector(document.getUuid(), params, document.isTrusted()); } }
ConstantThresholdDetectorFactoryProvider implements DetectorFactoryProvider<ConstantThresholdDetector> { @Override public ConstantThresholdDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val params = parseParams(document); return new ConstantThresholdDetector(document.getUuid(), params, document.isTrusted()); }  }
ConstantThresholdDetectorFactoryProvider implements DetectorFactoryProvider<ConstantThresholdDetector> { @Override public ConstantThresholdDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val params = parseParams(document); return new ConstantThresholdDetector(document.getUuid(), params, document.isTrusted()); }  @Override ConstantThresholdDetector buildDetector(DetectorDocument document); }
ConstantThresholdDetectorFactoryProvider implements DetectorFactoryProvider<ConstantThresholdDetector> { @Override public ConstantThresholdDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val params = parseParams(document); return new ConstantThresholdDetector(document.getUuid(), params, document.isTrusted()); }  @Override ConstantThresholdDetector buildDetector(DetectorDocument document);  }