[ 
https://issues.apache.org/jira/browse/METRON-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16469420#comment-16469420
 ] 

ASF GitHub Bot commented on METRON-1549:
----------------------------------------

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

    https://github.com/apache/metron/pull/1009#discussion_r187160397
  
    --- Diff: 
metron-platform/metron-parsers/src/test/java/org/apache/metron/writers/integration/WriterBoltIntegrationTest.java
 ---
    @@ -166,6 +185,139 @@ public void test() throws UnableToStartException, 
IOException, ParseException {
         }
       }
     
    +  /**
    +   * {
    +   *    
"parserClassName":"org.apache.metron.writers.integration.WriterBoltIntegrationTest$EmptyObjectParser",
    +   *    "sensorTopic":"emptyobjectparser",
    +   *    "outputTopic": "enrichments",
    +   *    "errorTopic": "parser_error"
    +   * }
    +   */
    +  @Multiline
    +  public static String offsetParserConfigJSON;
    +
    +  @Test
    +  public void commits_kafka_offsets_for_emtpy_objects() throws Exception {
    +    final String sensorType = "emptyobjectparser";
    +
    +    SensorParserConfig parserConfig = 
JSONUtils.INSTANCE.load(offsetParserConfigJSON, SensorParserConfig.class);
    +
    +    // the input messages to parser
    +    final List<byte[]> inputMessages = new ArrayList<byte[]>() {{
    +      add(Bytes.toBytes("foo"));
    +      add(Bytes.toBytes("bar"));
    +      add(Bytes.toBytes("baz"));
    +    }};
    +
    +    // setup external components; zookeeper, kafka
    +    final Properties topologyProperties = new Properties();
    --- End diff --
    
    Both test cases **seem** to do the same or similar component setup for Zk, 
Kafka, etc.  Can we extract any duplicate logic into a shared method?  Maybe 
just creating a "setup(@Before)" and "teardown(@After)" methods could handle 
that logic.
    
    Pulling that logic out will also make it easier for me to understand the 
specifics of what each test case is intended to test.


> Add empty object test to WriterBoltIntegrationTest implementation
> -----------------------------------------------------------------
>
>                 Key: METRON-1549
>                 URL: https://issues.apache.org/jira/browse/METRON-1549
>             Project: Metron
>          Issue Type: Test
>            Reporter: Michael Miklavcic
>            Assignee: Michael Miklavcic
>            Priority: Major
>
> Verify expected output when empty objects returned by custom parsers.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to