assertThat(sink2, eventually(hasContentsThat(equalTo("DRACARYS!"))));
}
@Test
public void testNamedChannels() throws Exception {
HttpSource source1 = newHttpSource();
HttpSource source2 = newHttpSource();
HttpSource source3 = newHttpSource();
FileSink sink = newFileSink().binary(true);
String streamName0 = generateStreamName();
String streamName1 = generateStreamName();
String streamName2 = generateStreamName();
String queue = generateQueueName();
stream().create(streamName0, "%s > %s", source1, queue);
stream().create(streamName1, "%s > %s", source2, queue);
stream().create(streamName2, "%s > %s", queue, sink);
source1.ensureReady().postData("Dracarys!");
source2.ensureReady().postData("testing");
assertThat(String.format("Assert failed for streams %s, %s, %s", streamName0, streamName1, streamName2),
sink, eventually(hasContentsThat(equalTo("Dracarys!testing"))));
stream().destroyStream(streamName1);
source1.ensureReady().postData("stillup");
assertThat(sink, eventually(hasContentsThat(equalTo("Dracarys!testingstillup"))));
stream().create(generateStreamName(), "%s > %s", source3, queue);
source3.ensureReady().postData("newstream");
assertThat(sink, eventually(hasContentsThat(equalTo("Dracarys!testingstillupnewstream"))));
}