diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java index 017a9d1494a..07ca81fb471 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorDstu3Test.java @@ -46,7 +46,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { @Before public void before() { - myGen = new DefaultThymeleafNarrativeGenerator(ourCtx); + myGen = new DefaultThymeleafNarrativeGenerator(); myGen.setUseHapiServerConformanceNarrative(true); ourCtx.setNarrativeGenerator(myGen); @@ -71,7 +71,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { value.setBirthDate(new Date()); - myGen.populateResourceNarrative(value); + myGen.populateResourceNarrative(ourCtx, value); String output = value.getText().getDiv().getValueAsString(); ourLog.info(output); assertThat(output, StringContains.containsString("
joe john BLOW
")); @@ -80,7 +80,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { @Test public void testTranslations() throws DataFormatException { - CustomThymeleafNarrativeGenerator customGen = new CustomThymeleafNarrativeGenerator(ourCtx, "classpath:/testnarrative.properties"); + CustomThymeleafNarrativeGenerator customGen = new CustomThymeleafNarrativeGenerator("classpath:/testnarrative.properties"); FhirContext ctx = FhirContext.forDstu3(); ctx.setNarrativeGenerator(customGen); @@ -114,7 +114,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { } }); - customGen.populateResourceNarrative(value); + customGen.populateResourceNarrative(ourCtx, value); String output = value.getText().getDiv().getValueAsString(); ourLog.info(output); assertThat(output, StringContains.containsString("Some beautiful proze")); @@ -130,7 +130,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { value.addResult().setReference("Observation/2"); value.addResult().setReference("Observation/3"); - myGen.populateResourceNarrative(value); + myGen.populateResourceNarrative(ourCtx, value); String output = value.getText().getDiv().getValueAsString(); ourLog.info(output); @@ -158,7 +158,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { // ourLog.info(output); // assertEquals("Operation Outcome (2 issues)", output); - myGen.populateResourceNarrative(oo); + myGen.populateResourceNarrative(ourCtx, oo); String output = oo.getText().getDiv().getValueAsString(); ourLog.info(output); @@ -197,7 +197,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { value.addResult().setResource(obs); } - myGen.populateResourceNarrative(value); + myGen.populateResourceNarrative(ourCtx, value); String output = value.getText().getDiv().getValueAsString(); ourLog.info(output); @@ -217,7 +217,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { mp.setStatus(MedicationRequestStatus.ACTIVE); mp.setAuthoredOnElement(new DateTimeType("2014-09-01")); - myGen.populateResourceNarrative(mp); + myGen.populateResourceNarrative(ourCtx, mp); String output = mp.getText().getDiv().getValueAsString(); assertTrue("Expected medication name of ciprofloaxin within narrative: "+output, output.contains("ciprofloaxin")); @@ -230,7 +230,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu3Test { Medication med = new Medication(); med.getCode().setText("ciproflaxin"); - myGen.populateResourceNarrative(med); + myGen.populateResourceNarrative(ourCtx, med); String output = med.getText().getDiv().getValueAsString(); assertThat(output, containsString("ciproflaxin")); diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BundleTypeInResponseHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BundleTypeInResponseHl7OrgTest.java index 67d1a2ccdf6..eb4cb0ddee5 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BundleTypeInResponseHl7OrgTest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BundleTypeInResponseHl7OrgTest.java @@ -64,7 +64,7 @@ public class BundleTypeInResponseHl7OrgTest { ServletHandler proxyHandler = new ServletHandler(); RestfulServer servlet = new RestfulServer(ourCtx); - servlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator(ourCtx)); + servlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); servlet.setResourceProviders(patientProvider); ServletHolder servletHolder = new ServletHolder(servlet); @@ -83,7 +83,7 @@ public class BundleTypeInResponseHl7OrgTest { @Search public List findPatient() { - ArrayList retVal = new ArrayList(); + ArrayList retVal = new ArrayList<>(); Patient patient = new Patient(); patient.setId("1"); diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamR4Test.java index 33104f239f7..f756ff0de84 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/param/DateRangeParamR4Test.java @@ -449,7 +449,7 @@ public class DateRangeParamR4Test { ServletHandler proxyHandler = new ServletHandler(); RestfulServer servlet = new RestfulServer(ourCtx); - servlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator(ourCtx)); + servlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); servlet.setResourceProviders(patientProvider); ServletHolder servletHolder = new ServletHolder(servlet); diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchSearchServerDstu1Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchSearchServerDstu1Test.java index 9b31d2fad74..9fa5bff32d7 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchSearchServerDstu1Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchSearchServerDstu1Test.java @@ -474,7 +474,7 @@ public class SearchSearchServerDstu1Test { ServletHandler proxyHandler = new ServletHandler(); ourServlet = new RestfulServer(ourCtx); - ourServlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator(ourCtx)); + ourServlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); ourServlet.setPagingProvider(new FifoMemoryPagingProvider(10).setDefaultPageSize(10)); ourServlet.setResourceProviders(patientProvider, new DummyObservationResourceProvider()); @@ -517,7 +517,7 @@ public class SearchSearchServerDstu1Test { @Search(compartmentName = "fooCompartment") public List compartment(@IdParam IdType theId) { - ArrayList retVal = new ArrayList(); + ArrayList retVal = new ArrayList<>(); Patient patient = new Patient(); patient.setId(theId);