use of kafka.serializer.DefaultDecoder in project incubator-gobblin by apache.
the class MockKafkaStream method createMockStream.
@SuppressWarnings("unchecked")
private static KafkaStream<byte[], byte[]> createMockStream(BlockingQueue<FetchedDataChunk> queue) {
KafkaStream<byte[], byte[]> stream = (KafkaStream<byte[], byte[]>) Mockito.mock(KafkaStream.class);
ConsumerIterator<byte[], byte[]> it = new ConsumerIterator<>(queue, -1, new DefaultDecoder(new VerifiableProperties()), new DefaultDecoder(new VerifiableProperties()), "clientId");
Mockito.when(stream.iterator()).thenReturn(it);
return stream;
}
Aggregations