From 0e95aa30087fa498f81737592e0d612b4104d7fb Mon Sep 17 00:00:00 2001 From: Lloyd McKenzie Date: Sun, 19 May 2019 16:23:31 -0600 Subject: [PATCH] The current test process succeeds incorrectly because of an NPE if the differential ends up including elements that aren't in the snapshot. We need a messaging array defined so that raising the errors doesn't cause an NPE. --- .../java/org/hl7/fhir/r5/test/SnapShotGenerationTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/SnapShotGenerationTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/SnapShotGenerationTests.java index 4d1a31c92..56dd19970 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/SnapShotGenerationTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/SnapShotGenerationTests.java @@ -301,6 +301,7 @@ public class SnapShotGenerationTests { private final TestScriptTestComponent test; private final String name; private SnapShotGenerationTestsContext context; + private List messages; public SnapShotGenerationTests(String name, TestScriptTestComponent e, SnapShotGenerationTestsContext context) { this.name = name; @@ -312,6 +313,7 @@ public class SnapShotGenerationTests { @Test public void test() throws FHIRException { try { + messages = new ArrayList(); for (Resource cr : context.tests.getContained()) { if (cr instanceof StructureDefinition) { StructureDefinition sd = (StructureDefinition) cr; @@ -344,7 +346,7 @@ public class SnapShotGenerationTests { StructureDefinition source = (StructureDefinition) context.fetchFixture(op.getSourceId()); StructureDefinition base = getSD(source.getBaseDefinition()); StructureDefinition output = source.copy(); - ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), null, new TestPKP()); + ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), messages , new TestPKP()); pu.setIds(source, false); if ("sort=true".equals(op.getParams())) { List errors = new ArrayList();