Search in sources :

Example 1 with Kafka08ConsumerRecord

use of org.apache.gobblin.kafka.client.Kafka08ConsumerClient.Kafka08ConsumerRecord in project incubator-gobblin by apache.

the class KafkaDeserializerExtractorTest method getMockMessageAndOffset.

private ByteArrayBasedKafkaRecord getMockMessageAndOffset(ByteBuffer payload) {
    MessageAndOffset mockMessageAndOffset = mock(MessageAndOffset.class);
    Message mockMessage = mock(Message.class);
    when(mockMessage.payload()).thenReturn(payload);
    when(mockMessageAndOffset.message()).thenReturn(mockMessage);
    return new Kafka08ConsumerRecord(mockMessageAndOffset, "test", 0);
}
Also used : Message(kafka.message.Message) Kafka08ConsumerRecord(org.apache.gobblin.kafka.client.Kafka08ConsumerClient.Kafka08ConsumerRecord) MessageAndOffset(kafka.message.MessageAndOffset)

Aggregations

Message (kafka.message.Message)1 MessageAndOffset (kafka.message.MessageAndOffset)1 Kafka08ConsumerRecord (org.apache.gobblin.kafka.client.Kafka08ConsumerClient.Kafka08ConsumerRecord)1