use of com.hazelcast.jet.core.test.TestOutbox in project hazelcast-jet by hazelcast.
the class StreamKafkaPTest method when_customProjectionToNull_then_filteredOut.
@Test
public void when_customProjectionToNull_then_filteredOut() {
// When
WatermarkGenerationParams<String> wmParams = wmGenParams(Long::parseLong, limitingLag(0), noThrottling(), 0);
StreamKafkaP processor = new StreamKafkaP<Integer, String, String>(properties, singletonList(topic1Name), r -> "0".equals(r.value()) ? null : r.value(), wmParams);
TestOutbox outbox = new TestOutbox(new int[] { 10 }, 10);
processor.init(outbox, new TestProcessorContext());
produce(topic1Name, 0, "0");
produce(topic1Name, 0, "1");
// Then
assertTrueEventually(() -> {
assertFalse(processor.complete());
assertFalse("no item in outbox", outbox.queue(0).isEmpty());
}, 3);
assertEquals("1", outbox.queue(0).poll());
assertNull(outbox.queue(0).poll());
}
Aggregations