@Test
public void testGenerateConfig() {
StreamSpec spec = new StreamSpec("stream-1", "physical-stream-1", "system-1", Collections.singletonMap("property1", "haha"));
StreamEdge edge = new StreamEdge(spec, false, false, new MapConfig());
Config config = edge.generateConfig();
StreamConfig streamConfig = new StreamConfig(config);
assertEquals(streamConfig.getSystem(spec.getId()), "system-1");
assertEquals(streamConfig.getPhysicalName(spec.getId()), "physical-stream-1");
assertEquals(streamConfig.getIsIntermediateStream(spec.getId()), false);
assertEquals(streamConfig.getStreamProperties(spec.getId()).get("property1"), "haha");
spec = new StreamSpec("stream-1", "physical-stream-1", "system-1", Collections.singletonMap("property1", "haha"));
edge = new StreamEdge(spec, false, false, new MapConfig());
config = edge.generateConfig();
streamConfig = new StreamConfig(config);
edge = new StreamEdge(spec, true, false, new MapConfig());
config = edge.generateConfig();
streamConfig = new StreamConfig(config);
assertEquals(streamConfig.getIsIntermediateStream(spec.getId()), true);
assertEquals(streamConfig.getDefaultStreamOffset(spec.toSystemStream()).get(), "oldest");
assertEquals(streamConfig.getPriority(spec.toSystemStream()), Integer.MAX_VALUE);
}
}