Search in sources :

Example 1 with FailOnInvalidTimestamp

use of org.apache.kafka.streams.processor.FailOnInvalidTimestamp in project kafka by apache.

the class RecordQueueTest method shouldThrowOnNegativeTimestamp.

@Test(expected = StreamsException.class)
public void shouldThrowOnNegativeTimestamp() {
    final List<ConsumerRecord<byte[], byte[]>> records = Collections.singletonList(new ConsumerRecord<>("topic", 1, 1, -1L, TimestampType.CREATE_TIME, 0L, 0, 0, recordKey, recordValue));
    final RecordQueue queue = new RecordQueue(new TopicPartition(topics[0], 1), new MockSourceNode<>(topics, intDeserializer, intDeserializer), new FailOnInvalidTimestamp());
    queue.addRawRecords(records);
}
Also used : TopicPartition(org.apache.kafka.common.TopicPartition) FailOnInvalidTimestamp(org.apache.kafka.streams.processor.FailOnInvalidTimestamp) ConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord) Test(org.junit.Test)

Aggregations

ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)1 TopicPartition (org.apache.kafka.common.TopicPartition)1 FailOnInvalidTimestamp (org.apache.kafka.streams.processor.FailOnInvalidTimestamp)1 Test (org.junit.Test)1