use of com.microsoft.applicationinsights.alerting.config.CollectionPlanConfiguration in project ApplicationInsights-Java by microsoft.
the class AlertingSubsystemTest method manualAlertWorks.
@Test
void manualAlertWorks() {
AtomicReference<AlertBreach> called = new AtomicReference<>();
Consumer<AlertBreach> consumer = called::set;
AlertingSubsystem service = AlertingSubsystem.create(consumer, Executors.newSingleThreadExecutor());
service.updateConfiguration(new AlertingConfiguration(new AlertConfiguration(AlertMetricType.CPU, true, 80, 30, 14400), new AlertConfiguration(AlertMetricType.MEMORY, true, 20, 120, 14400), new DefaultConfiguration(true, 5, 120), new CollectionPlanConfiguration(true, EngineMode.immediate, ZonedDateTime.now().plus(100, ChronoUnit.SECONDS), 120, "a-settings-moniker")));
assertThat(called.get().getType()).isEqualTo(AlertMetricType.MANUAL);
}
Aggregations