Search in sources :

Example 1 with DefaultDecoder

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;
}
Also used : VerifiableProperties(kafka.utils.VerifiableProperties) ConsumerIterator(kafka.consumer.ConsumerIterator) DefaultDecoder(kafka.serializer.DefaultDecoder) KafkaStream(kafka.consumer.KafkaStream)

Aggregations

ConsumerIterator (kafka.consumer.ConsumerIterator)1 KafkaStream (kafka.consumer.KafkaStream)1 DefaultDecoder (kafka.serializer.DefaultDecoder)1 VerifiableProperties (kafka.utils.VerifiableProperties)1