Repository: nifi Updated Branches: refs/heads/0.x a5cc94f87 -> f0e11c75b
Moved HL7 test file into TestExtractHL7Attributes, fixes NIFI-1979 Signed-off-by: Matt Burgess <mattyb...@apache.org> This closes #504 Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/f0e11c75 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/f0e11c75 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/f0e11c75 Branch: refs/heads/0.x Commit: f0e11c75b4585d3bcd5243f254f6522cd1706d89 Parents: a5cc94f Author: Joey Frazee <joey.fra...@icloud.com> Authored: Tue Jun 7 10:01:38 2016 -0500 Committer: Matt Burgess <mattyb...@apache.org> Committed: Tue Jun 7 11:19:09 2016 -0400 ---------------------------------------------------------------------- .../nifi/processors/hl7/TestExtractHL7Attributes.java | 11 +++++++++-- .../src/test/resources/hypoglycemia.hl7 | 5 ----- 2 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/f0e11c75/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/java/org/apache/nifi/processors/hl7/TestExtractHL7Attributes.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/java/org/apache/nifi/processors/hl7/TestExtractHL7Attributes.java b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/java/org/apache/nifi/processors/hl7/TestExtractHL7Attributes.java index 563219d..e8ecc1b 100644 --- a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/java/org/apache/nifi/processors/hl7/TestExtractHL7Attributes.java +++ b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/java/org/apache/nifi/processors/hl7/TestExtractHL7Attributes.java @@ -24,7 +24,7 @@ import org.junit.BeforeClass; import org.junit.Test; import java.io.IOException; -import java.nio.file.Paths; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.SortedMap; import java.util.TreeMap; @@ -38,6 +38,13 @@ public class TestExtractHL7Attributes { @Test public void testExtract() throws IOException { + final String inputRecord = + "MSH|^~\\&|XXXXXXXX||HealthProvider||||ORU^R01|Q1111111111111111111|P|2.3|\r\n" + + "PID|||12345^^^XYZ^MR||SMITH^JOHN||19700100|M||||||||||111111111111|123456789|\r\n" + + "PD1||||1234567890^LAST^FIRST^M^^^^^NPI|\r\n" + + "OBR|1|341856649^HNAM_ORDERID|000000000000000000|648088^Basic Metabolic Panel|||20150101000000|||||||||1620^Johnson^Corey^A||||||20150101000000|||F|||||||||||20150101000000|\r\n" + + "OBX|1|NM|GLU^Glucose Lvl|59|mg/dL|65-99^65^99|L|||F|||20150102000000|\r\n"; + final SortedMap<String, String> expectedAttributes = new TreeMap<>(); // MSH.1 and MSH.2 could be escaped, but it's not clear which is right expectedAttributes.put("MSH.1", "|"); @@ -75,7 +82,7 @@ public class TestExtractHL7Attributes { expectedAttributes.put("PID.19", "123456789"); final TestRunner runner = TestRunners.newTestRunner(ExtractHL7Attributes.class); - runner.enqueue(Paths.get("src/test/resources/hypoglycemia.hl7")); + runner.enqueue(inputRecord.getBytes(StandardCharsets.UTF_8)); runner.run(); runner.assertAllFlowFilesTransferred(ExtractHL7Attributes.REL_SUCCESS, 1); http://git-wip-us.apache.org/repos/asf/nifi/blob/f0e11c75/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/resources/hypoglycemia.hl7 ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/resources/hypoglycemia.hl7 b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/resources/hypoglycemia.hl7 deleted file mode 100644 index 8716aba..0000000 --- a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/test/resources/hypoglycemia.hl7 +++ /dev/null @@ -1,5 +0,0 @@ -MSH|^~\&|XXXXXXXX||HealthProvider||||ORU^R01|Q1111111111111111111|P|2.3| -PID|||12345^^^XYZ^MR||SMITH^JOHN||19700100|M||||||||||111111111111|123456789| -PD1||||1234567890^LAST^FIRST^M^^^^^NPI| -OBR|1|341856649^HNAM_ORDERID|000000000000000000|648088^Basic Metabolic Panel|||20150101000000|||||||||1620^Johnson^Corey^A||||||20150101000000|||F|||||||||||20150101000000| -OBX|1|NM|GLU^Glucose Lvl|59|mg/dL|65-99^65^99|L|||F|||20150102000000|