use of com.thinkbiganalytics.alerts.spi.AlertDescriptor in project kylo by Teradata.
the class InMemoryAlertManagerTest method testAddDescriptor.
@Test
public void testAddDescriptor() {
URI type = URI.create("urn:alert:test");
Map<Alert.State, String> states = new HashMap<>();
states.put(Alert.State.UNHANDLED, "application/json");
states.put(Alert.State.HANDLED, "application/json");
AlertDescriptor descr = new AlertDescriptor(URI.create("urn:alert:test"), "application/json", "description", true, states);
assertThat(this.manager.addDescriptor(descr)).isTrue();
Set<AlertDescriptor> descrSet = this.manager.getAlertDescriptors();
assertThat(descrSet).hasSize(1).extracting("alertType").contains(type);
assertThat(descrSet).extracting("contentType").contains("application/json");
assertThat(descrSet).extracting("description").contains("description");
assertThat(descrSet).extracting("respondable").contains(true);
}
Aggregations