From 9e69a684f47b7c8e0f3ca29381d787ceee0e2f29 Mon Sep 17 00:00:00 2001 From: depryf Date: Fri, 20 Oct 2023 09:34:31 -0400 Subject: [PATCH] Fixed more warnings (#125) --- CHANGELOG.md | 6 ++++++ build.gradle | 20 +++++++++---------- .../validation/ValidationXmlUtilsTest.java | 2 ++ .../MetafileContextFunctionsTest.java | 2 ++ .../StagingContextFunctionsTest.java | 2 +- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bf988d..e98490a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ **Version 3.1** +- Updated Groovy library from version 4.0.8 to version 4.0.15. +- Updated staging client from version 10.1.0 to version 11.0.0. + +**Version 3.1** + +- Updated Groovy library from version 4.0.8 to version 4.0.13. - Updated staging client from version 6.3.0 to version 10.1.0. **Version 3.0** diff --git a/build.gradle b/build.gradle index c357f2d..97537c9 100644 --- a/build.gradle +++ b/build.gradle @@ -24,21 +24,21 @@ repositories { } dependencies { - api 'com.imsweb:staging-client-java:10.2.0' - api 'org.apache.groovy:groovy:4.0.13' + api 'com.imsweb:staging-client-java:11.0.0' + api 'org.apache.groovy:groovy:4.0.15' api 'com.thoughtworks.xstream:xstream:1.4.20' implementation 'commons-codec:commons-codec:1.16.0' - implementation 'org.apache.commons:commons-lang3:3.12.0' + implementation 'org.apache.commons:commons-lang3:3.13.0' testImplementation 'junit:junit:4.13.2' - testImplementation 'commons-io:commons-io:2.13.0' - testImplementation 'com.imsweb:layout:5.2' - testImplementation 'com.imsweb:staging-client-java-cs:10.2.0' - testImplementation 'com.imsweb:staging-client-java-eod-public:10.2.0' - testImplementation 'com.imsweb:staging-client-java-tnm:10.2.0' - testImplementation('com.imsweb:validation-edits-seer:022-18') { exclude module: 'validation' } - testImplementation('com.imsweb:validation-edits-naaccr-translated:015-01') { exclude module: 'validation' } + testImplementation 'commons-io:commons-io:2.14.0' + testImplementation 'com.imsweb:layout:5.3' + testImplementation 'com.imsweb:staging-client-java-cs:11.0.0' + testImplementation 'com.imsweb:staging-client-java-eod-public:11.0.0' + testImplementation 'com.imsweb:staging-client-java-tnm:11.0.0' + testImplementation('com.imsweb:validation-edits-seer:023-08') { exclude module: 'validation' } + testImplementation('com.imsweb:validation-edits-naaccr-translated:018-01') { exclude module: 'validation' } } // enforce UTF-8, display the compilation warnings diff --git a/src/test/java/com/imsweb/validation/ValidationXmlUtilsTest.java b/src/test/java/com/imsweb/validation/ValidationXmlUtilsTest.java index 8be6270..6139724 100644 --- a/src/test/java/com/imsweb/validation/ValidationXmlUtilsTest.java +++ b/src/test/java/com/imsweb/validation/ValidationXmlUtilsTest.java @@ -186,6 +186,8 @@ public void testValidatorErrorWriteNullValidatorForWriter() throws IOException { public void testValidatorEmptyData() throws IOException, ConstructionException { Validator v = ValidationXmlUtils.loadValidatorFromXml(Thread.currentThread().getContextClassLoader().getResource("fake-validator-empty.xml")); + Assert.assertTrue(v.getRules().isEmpty()); + ValidationEngine.getInstance().addValidator(new EditableValidator(v)); ValidationEngine.getInstance().deleteValidator(new EditableValidator(v)); diff --git a/src/test/java/com/imsweb/validation/functions/MetafileContextFunctionsTest.java b/src/test/java/com/imsweb/validation/functions/MetafileContextFunctionsTest.java index 9c15ec9..63045cd 100644 --- a/src/test/java/com/imsweb/validation/functions/MetafileContextFunctionsTest.java +++ b/src/test/java/com/imsweb/validation/functions/MetafileContextFunctionsTest.java @@ -33,6 +33,7 @@ import static com.imsweb.validation.functions.MetafileContextFunctions.TRIM_LEFT; import static com.imsweb.validation.functions.MetafileContextFunctions.TRIM_RIGHT; +@SuppressWarnings("java:S5961") // methods too complex public class MetafileContextFunctionsTest { private MetafileContextFunctions _functions; @@ -1218,6 +1219,7 @@ public void testGEN_ILOOKUP() { } @Test + @SuppressWarnings("java:S5778") public void testGEN_SQLLOOKUP() { // define the table we are going to use diff --git a/src/test/java/com/imsweb/validation/functions/StagingContextFunctionsTest.java b/src/test/java/com/imsweb/validation/functions/StagingContextFunctionsTest.java index 11da9b5..6d5637d 100644 --- a/src/test/java/com/imsweb/validation/functions/StagingContextFunctionsTest.java +++ b/src/test/java/com/imsweb/validation/functions/StagingContextFunctionsTest.java @@ -563,7 +563,7 @@ public void testGetEodSchemaId() { input.clear(); input.put("primarySite", "C530"); input.put("histologicTypeIcdO3", "8000"); - Assert.assertNull(_functions.getEodSchemaId(input)); + Assert.assertEquals("cervix_9th_2021", _functions.getEodSchemaId(input)); input.put("dateOfDiagnosisYear", "2018"); Assert.assertEquals("cervix", _functions.getEodSchemaId(input)); }