From bc6b22389b94b95fe3bae79a141e20d007c58ea5 Mon Sep 17 00:00:00 2001
From: Mark Payne <markap14@hotmail.com>
Date: Thu, 4 Aug 2016 14:50:30 -0400
Subject: [PATCH] NIFI-2407: Fixed NPE

---
 .../nifi/processors/hadoop/GetHDFSSequenceFileTest.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFileTest.java b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFileTest.java
index 2ae99f0f4e..33bd135d89 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFileTest.java
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFileTest.java
@@ -26,6 +26,7 @@ import org.apache.nifi.hadoop.KerberosProperties;
 import org.apache.nifi.processor.ProcessContext;
 import org.apache.nifi.processor.ProcessorInitializationContext;
 import org.apache.nifi.processors.hadoop.util.SequenceFileReader;
+import org.apache.nifi.util.MockProcessContext;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
@@ -63,10 +64,7 @@ public class GetHDFSSequenceFileTest {
     }
 
     private void init() throws IOException {
-        ProcessContext context = mock(ProcessContext.class);
-        when(context.getProperty(AbstractHadoopProcessor.KERBEROS_RELOGIN_PERIOD)).thenReturn(mock(PropertyValue.class));
-        when(context.getProperty(AbstractHadoopProcessor.HADOOP_CONFIGURATION_RESOURCES)).thenReturn(mock(PropertyValue.class));
-        when(context.getProperty(AbstractHadoopProcessor.DIRECTORY_PROP_NAME)).thenReturn(mock(PropertyValue.class));
+        final MockProcessContext context = new MockProcessContext(getHDFSSequenceFile);
         getHDFSSequenceFile.init(mock(ProcessorInitializationContext.class));
         getHDFSSequenceFile.onScheduled(context);
     }