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

    https://github.com/apache/nifi/pull/492#discussion_r66292230
  
    --- Diff: 
nifi-nar-bundles/nifi-evtx-bundle/nifi-evtx-processors/src/test/java/org/apache/nifi/processors/evtx/ParseEvtxTest.java
 ---
    @@ -0,0 +1,318 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.nifi.processors.evtx;
    +
    +import org.apache.nifi.flowfile.FlowFile;
    +import org.apache.nifi.flowfile.attributes.CoreAttributes;
    +import org.apache.nifi.logging.ComponentLog;
    +import org.apache.nifi.processor.ProcessSession;
    +import org.apache.nifi.processor.io.OutputStreamCallback;
    +import org.apache.nifi.processors.evtx.parser.ChunkHeader;
    +import org.apache.nifi.processors.evtx.parser.FileHeader;
    +import org.apache.nifi.processors.evtx.parser.FileHeaderFactory;
    +import org.apache.nifi.processors.evtx.parser.MalformedChunkException;
    +import org.apache.nifi.processors.evtx.parser.Record;
    +import org.apache.nifi.processors.evtx.parser.bxml.RootNode;
    +import org.junit.Before;
    +import org.junit.Test;
    +import org.junit.runner.RunWith;
    +import org.mockito.Mock;
    +import org.mockito.runners.MockitoJUnitRunner;
    +
    +import javax.xml.stream.XMLStreamException;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.io.OutputStream;
    +import java.util.concurrent.atomic.AtomicReference;
    +
    +import static org.junit.Assert.assertEquals;
    +import static org.mockito.Mockito.any;
    +import static org.mockito.Mockito.anyString;
    +import static org.mockito.Mockito.eq;
    +import static org.mockito.Mockito.isA;
    +import static org.mockito.Mockito.mock;
    +import static org.mockito.Mockito.verify;
    +import static org.mockito.Mockito.verifyNoMoreInteractions;
    +import static org.mockito.Mockito.when;
    +
    +@RunWith(MockitoJUnitRunner.class)
    +public class ParseEvtxTest {
    --- End diff --
    
    This class tests the individual methods in the ParseEvtx processor, but not 
the processor lifecycle (like onTrigger). Can you add some more tests that 
exercise the processor? An example of using the nifi-mock framework can be 
found in TestEvaluateXPath, it has the TestRunner stuff with flowfiles, 
relationships, asserts, etc. You will likely want a test file or two to be used 
as input, although if line endings/whitespace are important in the format you 
may just need the data directly in the Java code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to