AlertStreamEvent extends StreamEvent { public AlertStreamEvent() { } AlertStreamEvent();  AlertStreamEvent(AlertStreamEvent event); void setPolicyId(String policyId); String getPolicyId(); @Override String toString(); String getCreatedBy(); void setCreatedBy(String createdBy); StreamDefinition getSchema(); void setSchema(StreamDefinition schema); long getCreatedTime(); void setCreatedTime(long createdTime); Map<String, Object> getDataMap(); Map<String, Object> getContext(); void setContext(Map<String, Object> context); String getAlertId(); void ensureAlertId(); String getSubject(); void setSubject(String subject); String getBody(); void setBody(String body); String getCategory(); void setCategory(String category); AlertSeverity getSeverity(); void setSeverity(AlertSeverity severity); String getSiteId(); void setSiteId(String siteId); boolean isDuplicationChecked(); void setDuplicationChecked(boolean duplicationChecked);  }
@Test public void testAlertStreamEvent() { List<StreamColumn> streamColumns = new ArrayList<>(); streamColumns.add(new StreamColumn.Builder().name("name").type(StreamColumn.Type.STRING).build()); streamColumns.add(new StreamColumn.Builder().name("host").type(StreamColumn.Type.STRING).build()); streamColumns.add(new StreamColumn.Builder().name("flag").type(StreamColumn.Type.BOOL).build()); streamColumns.add(new StreamColumn.Builder().name("value").type(StreamColumn.Type.DOUBLE).build()); streamColumns.add(new StreamColumn.Builder().name("data").type(StreamColumn.Type.LONG).build()); streamColumns.add(new StreamColumn.Builder().name("salary").type(StreamColumn.Type.FLOAT).build()); streamColumns.add(new StreamColumn.Builder().name("object").type(StreamColumn.Type.OBJECT).build()); streamColumns.add(new StreamColumn.Builder().name("int").type(StreamColumn.Type.INT).build()); StreamDefinition streamDefinition = new StreamDefinition(); streamDefinition.setColumns(streamColumns); AlertStreamEvent alertStreamEvent = new AlertStreamEvent(); alertStreamEvent.setSchema(streamDefinition); alertStreamEvent.setData(new Object[]{"namevalue", "hostvalue", "1", 10, 0.1, -0.2, "{\"name\":\"heap.COMMITTED\", \"Value\":\"175636480\"}", 1}); AlertStreamEvent alertStreamEvent1 = new AlertStreamEvent(alertStreamEvent); Assert.assertFalse(alertStreamEvent1 == alertStreamEvent); Assert.assertTrue(alertStreamEvent1.equals(alertStreamEvent)); Assert.assertTrue(alertStreamEvent1.hashCode() == alertStreamEvent.hashCode()); }