crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject [crunch] 03/03: Fix unnecessary stubbings in the kafka test suite
Date Fri, 15 Nov 2019 00:48:58 GMT
This is an automated email from the ASF dual-hosted git repository.

jwills pushed a commit to branch jwills_great_version_upgrade
in repository https://gitbox.apache.org/repos/asf/crunch.git

commit 362853da42b73d7eae5307269be60ca8ae814a02
Author: Josh Wills <jwills@apache.org>
AuthorDate: Thu Nov 14 16:48:33 2019 -0800

    Fix unnecessary stubbings in the kafka test suite
---
 .../test/java/org/apache/crunch/kafka/KafkaRecordsIterableIT.java    | 2 --
 .../java/org/apache/crunch/kafka/record/KafkaRecordReaderTest.java   | 5 +----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/crunch-kafka/src/test/java/org/apache/crunch/kafka/KafkaRecordsIterableIT.java
b/crunch-kafka/src/test/java/org/apache/crunch/kafka/KafkaRecordsIterableIT.java
index fd940f3..dd179ae 100644
--- a/crunch-kafka/src/test/java/org/apache/crunch/kafka/KafkaRecordsIterableIT.java
+++ b/crunch-kafka/src/test/java/org/apache/crunch/kafka/KafkaRecordsIterableIT.java
@@ -385,8 +385,6 @@ public class KafkaRecordsIterableIT {
           entry.getKey().partition(), entry.getValue() + 1, "key", null));
     }
 
-    when(records.isEmpty()).thenReturn(false);
-    when(records.iterator()).thenReturn(returnedRecords.iterator());
     when(mockedConsumer.poll(Matchers.anyLong()))
         //for the fill poll call
         .thenReturn(null)
diff --git a/crunch-kafka/src/test/java/org/apache/crunch/kafka/record/KafkaRecordReaderTest.java
b/crunch-kafka/src/test/java/org/apache/crunch/kafka/record/KafkaRecordReaderTest.java
index fd8cd8e..4b3a548 100644
--- a/crunch-kafka/src/test/java/org/apache/crunch/kafka/record/KafkaRecordReaderTest.java
+++ b/crunch-kafka/src/test/java/org/apache/crunch/kafka/record/KafkaRecordReaderTest.java
@@ -63,9 +63,6 @@ public class KafkaRecordReaderTest {
 
     inputSplit = new KafkaInputSplit(topicPartition.topic(), topicPartition.partition(),
startOffset, endOffset);
 
-    when(consumer.beginningOffsets(Collections.singleton(inputSplit.getTopicPartition()))).thenReturn(
-        Collections.singletonMap(inputSplit.getTopicPartition(), 0L));
-
     records = new ConsumerRecords<>(Collections.singletonMap(inputSplit.getTopicPartition(),
         Collections.singletonList(new ConsumerRecord<>("topic", 0, 0, "key", "value"))));
 
@@ -166,4 +163,4 @@ public class KafkaRecordReaderTest {
       return consumer;
     }
   }
-}
\ No newline at end of file
+}


Mime
View raw message