Github user srdo commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2755#discussion_r200803791
  
    --- Diff: 
external/storm-kafka-client/src/test/java/org/apache/storm/kafka/spout/NamedTopicFilterTest.java
 ---
    @@ -63,6 +63,20 @@ public void testFilter() {
                 
         }
         
    +    @Test
    +    public void testAbsentTopic() {
    +        String presentTopic = "present";
    +        String absentTopic = "absent";
    +        
    +        NamedTopicFilter filter = new NamedTopicFilter(presentTopic, 
absentTopic);
    +        
when(consumerMock.partitionsFor(presentTopic)).thenReturn(Collections.singletonList(createPartitionInfo(presentTopic,
 2)));
    +        when(consumerMock.partitionsFor(absentTopic)).thenReturn(null);
    +        
    +        List<TopicPartition> presentPartitions = 
filter.getFilteredTopicPartitions(consumerMock);
    +        assertThat("Expected filter to pass only topics which are 
present", presentPartitions,
    +            containsInAnyOrder(new TopicPartition(presentTopic, 2)));
    --- End diff --
    
    Nit: When there is only one entry, you don't have to specify "in any order" 
:)


---

Reply via email to