From dcf3f5f2186fb2cbe16679b8607ebda21728e21c Mon Sep 17 00:00:00 2001 From: markiantorno Date: Wed, 26 Aug 2020 17:26:39 -0400 Subject: [PATCH] Upping UCUM dependency, fixing old junit dependencies --- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- .../dstu2016may/utils/client/ClientUtils.java | 4 --- .../test/BaseDateTimeTypeTest.java | 7 ++--- .../dstu2016may/test/ClientUtilsTest.java | 25 --------------- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- .../hl7/fhir/r4/test/GraphQLEngineTests.java | 9 +++--- .../hl7/fhir/r4/test/GraphQLParserTests.java | 5 ++- .../fhir/r4/test/ResourceRoundTripTests.java | 4 +-- .../fhir/r4/test/SnomedExpressionsTests.java | 5 ++- org.hl7.fhir.r5/pom.xml | 2 +- .../hl7/fhir/r5/test/CDARoundTripTests.java | 6 ++-- .../r5/test/StructureMapUtilitiesTest.java | 31 +++++++++---------- .../org/hl7/fhir/r5/test/XmlParserTests.java | 7 ++--- 15 files changed, 38 insertions(+), 75 deletions(-) delete mode 100644 org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/ClientUtilsTest.java diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 952da7f41..644d259ae 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -28,7 +28,7 @@ org.fhir ucum - 1.0.2 + 1.0.3 true diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 7fe5df467..f6e5bb358 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -28,7 +28,7 @@ org.fhir ucum - 1.0.2 + 1.0.3 true diff --git a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ClientUtils.java b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ClientUtils.java index 06ebdbc4f..53cc6a83b 100644 --- a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ClientUtils.java +++ b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ClientUtils.java @@ -214,7 +214,6 @@ public class ClientUtils { /** * @param resourceFormat - * @param options * @return */ protected ResourceRequest issueResourceRequest(String resourceFormat, HttpUriRequest request, byte[] payload, int timeoutLoading) { @@ -223,7 +222,6 @@ public class ClientUtils { /** * @param resourceFormat - * @param options * @return */ protected ResourceRequest issueResourceRequest(String resourceFormat, HttpUriRequest request, byte[] payload, List
headers, int timeoutLoading) { @@ -314,9 +312,7 @@ public class ClientUtils { } /** - * * @param request - * @param payload * @return */ protected HttpResponse sendRequest(HttpUriRequest request) { diff --git a/org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/BaseDateTimeTypeTest.java b/org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/BaseDateTimeTypeTest.java index 384ad0faa..be7f522cf 100644 --- a/org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/BaseDateTimeTypeTest.java +++ b/org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/BaseDateTimeTypeTest.java @@ -3,6 +3,7 @@ package org.hl7.fhir.dstu2016may.test; import ca.uhn.fhir.model.api.TemporalPrecisionEnum; import org.hl7.fhir.dstu2016may.model.DateType; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -11,8 +12,6 @@ import java.util.Calendar; import java.util.Date; import java.util.TimeZone; -import static org.junit.Assert.assertEquals; - public class BaseDateTimeTypeTest { private SimpleDateFormat myDateInstantParser; @@ -34,7 +33,7 @@ public class BaseDateTimeTypeTest { DateType date = new DateType(); date.setValue(time, TemporalPrecisionEnum.DAY); - assertEquals("2012-01-02", date.getValueAsString()); + Assertions.assertEquals("2012-01-02", date.getValueAsString()); } /** @@ -50,6 +49,6 @@ public class BaseDateTimeTypeTest { DateType date = new DateType(); date.setValue(time); - assertEquals("2012-01-02", date.getValueAsString()); + Assertions.assertEquals("2012-01-02", date.getValueAsString()); } } \ No newline at end of file diff --git a/org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/ClientUtilsTest.java b/org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/ClientUtilsTest.java deleted file mode 100644 index 9785afc55..000000000 --- a/org.hl7.fhir.dstu2016may/src/test/java/org/hl7/fhir/dstu2016may/test/ClientUtilsTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.hl7.fhir.dstu2016may.test; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; - -public class ClientUtilsTest { - - @BeforeClass - public static void setUpBeforeClass() { - } - - @AfterClass - public static void tearDownAfterClass() { - } - - @Before - public void setUp() { - } - - @After - public void tearDown() { - } -} \ No newline at end of file diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index dd8125d1e..79f00be03 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -28,7 +28,7 @@ org.fhir ucum - 1.0.2 + 1.0.3 true diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index dae4c797a..4418d0d34 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -35,7 +35,7 @@ org.fhir ucum - 1.0.2 + 1.0.3 true diff --git a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLEngineTests.java b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLEngineTests.java index c52cb3233..0dc6c5379 100644 --- a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLEngineTests.java +++ b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLEngineTests.java @@ -19,6 +19,7 @@ import org.hl7.fhir.utilities.graphql.IGraphQLStorageServices; import org.hl7.fhir.utilities.graphql.NameValue; import org.hl7.fhir.utilities.graphql.Parser; import org.hl7.fhir.utilities.xml.XMLUtil; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -36,8 +37,6 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; -import static org.junit.Assert.assertTrue; - @Disabled public class GraphQLEngineTests implements IGraphQLStorageServices { @@ -86,15 +85,15 @@ public class GraphQLEngineTests implements IGraphQLStorageServices { msg = e.getMessage(); } if (ok) { - assertTrue("Expected to fail, but didn't", !output.equals("$error")); + Assertions.assertTrue(!output.equals("$error"), "Expected to fail, but didn't"); StringBuilder str = new StringBuilder(); gql.getOutput().setWriteWrapper(false); gql.getOutput().write(str, 0); TextFile.stringToFile(str.toString(), TestingUtilities.resourceNameToFile("graphql", output + ".out")); msg = TestingUtilities.checkJsonIsSame(TestingUtilities.resourceNameToFile("graphql", output + ".out"), TestingUtilities.resourceNameToFile("graphql", output)); - assertTrue(msg, Utilities.noString(msg)); + Assertions.assertTrue(Utilities.noString(msg), msg); } else - assertTrue("Error, but proper output was expected (" + msg + ")", output.equals("$error")); + Assertions.assertTrue(output.equals("$error"), "Error, but proper output was expected (" + msg + ")"); } @Override diff --git a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLParserTests.java b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLParserTests.java index f49a3e33b..acb01315d 100644 --- a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLParserTests.java +++ b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/GraphQLParserTests.java @@ -7,6 +7,7 @@ import org.hl7.fhir.utilities.graphql.EGraphEngine; import org.hl7.fhir.utilities.graphql.EGraphQLException; import org.hl7.fhir.utilities.graphql.Package; import org.hl7.fhir.utilities.graphql.Parser; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -18,8 +19,6 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; -import static org.junit.Assert.assertTrue; - @Disabled public class GraphQLParserTests { @@ -40,7 +39,7 @@ public class GraphQLParserTests { @MethodSource("data") public void test(String name, String test) throws IOException, EGraphQLException, EGraphEngine { Package doc = Parser.parse(test); - assertTrue(doc != null); + Assertions.assertTrue(doc != null); } diff --git a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/ResourceRoundTripTests.java b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/ResourceRoundTripTests.java index ee4295fde..d595577a1 100644 --- a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/ResourceRoundTripTests.java +++ b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/ResourceRoundTripTests.java @@ -12,7 +12,7 @@ import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.test.utils.TestingUtilities; import org.hl7.fhir.r4.utils.EOperationOutcome; import org.hl7.fhir.r4.utils.NarrativeGenerator; -import org.junit.Before; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -20,7 +20,7 @@ import java.io.*; public class ResourceRoundTripTests { - @Before + @BeforeAll public void setUp() throws Exception { } diff --git a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/SnomedExpressionsTests.java b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/SnomedExpressionsTests.java index 5fcc7d2e8..aed9807e1 100644 --- a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/SnomedExpressionsTests.java +++ b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/test/SnomedExpressionsTests.java @@ -2,10 +2,9 @@ package org.hl7.fhir.r4.test; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r4.utils.SnomedExpressions; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertNotNull; - public class SnomedExpressionsTests { @Test @@ -47,7 +46,7 @@ public class SnomedExpressionsTests { } private void p(String expression) throws FHIRException { - assertNotNull("must be present", SnomedExpressions.parse(expression)); + Assertions.assertNotNull(SnomedExpressions.parse(expression), "must be present"); } diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 317244039..bbb4328fd 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -34,7 +34,7 @@ org.fhir ucum - 1.0.2 + 1.0.3 true diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java index 94f49a943..e95a03ca0 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/CDARoundTripTests.java @@ -1,7 +1,5 @@ package org.hl7.fhir.r5.test; -import static org.junit.Assert.assertTrue; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -251,7 +249,7 @@ public class CDARoundTripTests { TestingUtilities.loadTestResourceStream("validator", "cda", "example.xml"), FhirFormat.XML); List title = xml.getChildrenByName("title"); - assertTrue(title != null && title.size() == 1); + Assertions.assertTrue(title != null && title.size() == 1); Element value = title.get(0).getChildren().get(0); @@ -261,7 +259,7 @@ public class CDARoundTripTests { ByteArrayOutputStream baosXml = new ByteArrayOutputStream(); Manager.compose(TestingUtilities.context(), xml, baosXml, FhirFormat.XML, OutputStyle.PRETTY, null); String cdaSerialised = baosXml.toString("UTF-8"); - assertTrue(cdaSerialised.indexOf("öé") > 0); + Assertions.assertTrue(cdaSerialised.indexOf("öé") > 0); } } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java index b804ad3a9..dc9285a84 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java @@ -1,7 +1,5 @@ package org.hl7.fhir.r5.test; -import static org.junit.Assert.assertEquals; - import java.io.IOException; import java.util.List; @@ -17,6 +15,7 @@ import org.hl7.fhir.r5.utils.StructureMapUtilities.ITransformerServices; import org.hl7.fhir.utilities.cache.FilesystemPackageCacheManager; import org.hl7.fhir.utilities.cache.ToolsVersion; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class StructureMapUtilitiesTest implements ITransformerServices { @@ -36,28 +35,28 @@ public class StructureMapUtilitiesTest implements ITransformerServices { StructureMap structureMap = scu.parse(fileMap, "ActivityDefinition3To4"); // StructureMap/ActivityDefinition3to4: StructureMap.group[3].rule[2].name error id value '"expression"' is not valid - assertEquals("expression", structureMap.getGroup().get(2).getRule().get(1).getName()); + Assertions.assertEquals("expression", structureMap.getGroup().get(2).getRule().get(1).getName()); } private void assertSerializeDeserialize(StructureMap structureMap) { - assertEquals("syntax", structureMap.getName()); - assertEquals("Title of this map\r\nAuthor", structureMap.getDescription()); - assertEquals("http://github.com/FHIR/fhir-test-cases/r5/fml/syntax", structureMap.getUrl()); - assertEquals("Patient", structureMap.getStructure().get(0).getAlias()); - assertEquals("http://hl7.org/fhir/StructureDefinition/Patient", structureMap.getStructure().get(0).getUrl()); - assertEquals("Source Documentation", structureMap.getStructure().get(0).getDocumentation()); - assertEquals("http://hl7.org/fhir/StructureDefinition/Patient", structureMap.getStructure().get(0).getUrl()); - assertEquals("http://hl7.org/fhir/StructureDefinition/Basic", structureMap.getStructure().get(1).getUrl()); - assertEquals("Target Documentation", structureMap.getStructure().get(1).getDocumentation()); - assertEquals("Groups\r\nrule for patient group", structureMap.getGroup().get(0).getDocumentation()); - assertEquals("Comment to rule", structureMap.getGroup().get(0).getRule().get(0).getDocumentation()); - assertEquals("Copy identifier short syntax", structureMap.getGroup().get(0).getRule().get(1).getDocumentation()); + Assertions.assertEquals("syntax", structureMap.getName()); + Assertions.assertEquals("Title of this map\r\nAuthor", structureMap.getDescription()); + Assertions.assertEquals("http://github.com/FHIR/fhir-test-cases/r5/fml/syntax", structureMap.getUrl()); + Assertions.assertEquals("Patient", structureMap.getStructure().get(0).getAlias()); + Assertions.assertEquals("http://hl7.org/fhir/StructureDefinition/Patient", structureMap.getStructure().get(0).getUrl()); + Assertions.assertEquals("Source Documentation", structureMap.getStructure().get(0).getDocumentation()); + Assertions.assertEquals("http://hl7.org/fhir/StructureDefinition/Patient", structureMap.getStructure().get(0).getUrl()); + Assertions.assertEquals("http://hl7.org/fhir/StructureDefinition/Basic", structureMap.getStructure().get(1).getUrl()); + Assertions.assertEquals("Target Documentation", structureMap.getStructure().get(1).getDocumentation()); + Assertions.assertEquals("Groups\r\nrule for patient group", structureMap.getGroup().get(0).getDocumentation()); + Assertions.assertEquals("Comment to rule", structureMap.getGroup().get(0).getRule().get(0).getDocumentation()); + Assertions.assertEquals("Copy identifier short syntax", structureMap.getGroup().get(0).getRule().get(1).getDocumentation()); StructureMapGroupRuleTargetComponent target = structureMap.getGroup().get(0).getRule().get(2).getTarget().get(1); - assertEquals("'urn:uuid:' + r.lower()", target.getParameter().get(0).toString()); + Assertions.assertEquals("'urn:uuid:' + r.lower()", target.getParameter().get(0).toString()); } @Test diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java index 6c2376db3..bda09cbf3 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/XmlParserTests.java @@ -1,7 +1,5 @@ package org.hl7.fhir.r5.test; -import static org.junit.Assert.assertTrue; - import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -15,6 +13,7 @@ import org.hl7.fhir.r5.test.utils.TestingUtilities; import org.hl7.fhir.r5.utils.FHIRPathEngine; import org.hl7.fhir.utilities.cache.FilesystemPackageCacheManager; import org.hl7.fhir.utilities.cache.ToolsVersion; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -59,7 +58,7 @@ public class XmlParserTests { Manager.compose(context, cda, baosXml, FhirFormat.XML, OutputStyle.PRETTY, null); String cdaSerialised = baosXml.toString(); - assertTrue(cdaSerialised.indexOf("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"")>0); - assertTrue(cdaSerialised.indexOf("xsi:type=\"CD\"")>0); + Assertions.assertTrue(cdaSerialised.indexOf("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"")>0); + Assertions.assertTrue(cdaSerialised.indexOf("xsi:type=\"CD\"")>0); } } \ No newline at end of file