cameronlee314 commented on a change in pull request #918: SAMZA-2094: Implement
the StartpointVisitor for the KafkaSystemConsumer.
URL: https://github.com/apache/samza/pull/918#discussion_r267008613
##########
File path:
samza-kafka/src/test/java/org/apache/samza/system/kafka/TestKafkaSystemConsumer.java
##########
@@ -206,6 +225,166 @@ public void testFetchThresholdBytesDiabled() {
consumer.stop();
}
+ @Test
+ public void
testStartpointSpecificOffsetVisitorShouldUpdateTheFetchOffsetInConsumer() {
+ final KafkaConsumer consumer = Mockito.mock(KafkaConsumer.class);
+ final KafkaConsumerProxy kafkaConsumerProxy =
Mockito.mock(KafkaConsumerProxy.class);
+ KafkaSystemConsumer kafkaSystemConsumer = new
KafkaSystemConsumer(consumer, TEST_SYSTEM, new MapConfig(), TEST_CLIENT_ID,
kafkaConsumerProxy, Mockito.mock(KafkaSystemConsumerMetrics.class), new
TestClock(), REGISTRATION_HANDLER);
+ KafkaStartpointRegistrationHandler kafkaStartpointRegistrationHandler =
kafkaSystemConsumer.new KafkaStartpointRegistrationHandler();
Review comment:
It seems kind of awkward to test like this, where you put in the mock
registration handler, and then create a new one to actually test with. Could
you make `KafkaStartpointRegistrationHandler` a static inner class and then
pass the necessary objects to it? In my opinion, non-static inner classes are
harder to read/maintain anyways.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services