From d554545741a663d325a58b4a30f1d477e8f38dd6 Mon Sep 17 00:00:00 2001 From: Justin Tay <49700559+justin-tay@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:28:55 +0800 Subject: [PATCH] Update dependency versions --- pom.xml | 48 ++++++++++++------- .../schema/MaximumValidatorTest.java | 7 ++- .../schema/MinimumValidatorTest.java | 7 ++- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index b1d613c21..1959b65f5 100644 --- a/pom.xml +++ b/pom.xml @@ -71,15 +71,27 @@ 1.8 1.8 UTF-8 - 2.2 - 1.8.0 - 2.15.3 - 2.1.41 - 5.9.2 + + 1.10.2 + 2.17.0 + 2.2.1 1.3.14 - 2.0.9 - 3.0.0 + 2.0.13 + + 2.2 + 5.10.2 2.2.31.Final + + 0.8.12 + 3.13.0 + 5.1.9 + 1.6 + 3.6.3 + 3.3.1 + 1.2.1 + 3.2.5 + 1.2.1.Final + 1.6.13 @@ -184,7 +196,7 @@ org.apache.felix maven-bundle-plugin - 5.1.8 + ${version.maven-bundle-plugin} true @@ -202,7 +214,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + ${version.nexus-staging-maven-plugin} true ossrh @@ -214,7 +226,7 @@ org.apache.maven.plugins maven-source-plugin - 3.0.1 + ${version.maven-source-plugin} attach-sources @@ -228,7 +240,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + ${version.maven-javadoc-plugin} attach-javadocs @@ -245,7 +257,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + ${version.maven-compiler-plugin} ${java.version} ${java.version} @@ -270,7 +282,7 @@ org.apache.maven.plugins maven-surefire-plugin - ${version.surefire} + ${version.maven-surefire-plugin} @{argLine} -Duser.language=en -Duser.region=GB plain @@ -291,7 +303,7 @@ me.fabriciorby maven-surefire-junit5-tree-reporter - 1.1.0 + ${version.maven-surefire-junit5-tree-reporter} @@ -299,7 +311,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + ${version.jacoco-maven-plugin} @@ -346,7 +358,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - ${version.surefire} + ${version.maven-surefire-plugin} @@ -366,7 +378,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + ${version.maven-gpg-plugin} sign-artifacts @@ -391,7 +403,7 @@ org.moditect moditect-maven-plugin - 1.0.0.Final + ${version.moditect-maven-plugin} add-module-infos diff --git a/src/test/java/com/networknt/schema/MaximumValidatorTest.java b/src/test/java/com/networknt/schema/MaximumValidatorTest.java index 6f5a9cb7e..d252648b3 100644 --- a/src/test/java/com/networknt/schema/MaximumValidatorTest.java +++ b/src/test/java/com/networknt/schema/MaximumValidatorTest.java @@ -208,7 +208,8 @@ public void negativeDoubleOverflowTest() throws IOException { v = factory.getSchema(bigDecimalMapper.readTree(schema), config); Set messages3 = v.validate(doc); //when the schema and value are both using BigDecimal, the value should be parsed in same mechanism. - if (maximum.toLowerCase().equals(value.toLowerCase()) || Double.valueOf(maximum).equals(Double.POSITIVE_INFINITY)) { + String theValue = value.toLowerCase().replace("\"", ""); + if (maximum.toLowerCase().equals(theValue)) { assertTrue(messages3.isEmpty(), format("Maximum %s and value %s are equal, thus no schema violation should be reported", maximum, value)); } else { assertFalse(messages3.isEmpty(), format("Maximum %s is smaller than value %s , should be validation error reported", maximum, value)); @@ -278,7 +279,9 @@ public void doubleValueCoarsingExceedRange() throws IOException { */ v = factory.getSchema(bigDecimalMapper.readTree(schema)); messages = v.validate(doc); - assertTrue(messages.isEmpty(), "Validation should success because the bug of bigDecimalMapper, it will treat 1.7976931348623159e+308 as INFINITY"); + // Before 2.16.0 messages will be empty due to bug https://github.com/FasterXML/jackson-databind/issues/1770 + // assertTrue(messages.isEmpty(), "Validation should success because the bug of bigDecimalMapper, it will treat 1.7976931348623159e+308 as INFINITY"); + assertFalse(messages.isEmpty(), "Validation should fail as Incorrect deserialization for BigDecimal numbers is fixed in 2.16.0"); } private static final String POSITIVE_TEST_CASE_TEMPLATE = "Expecting no validation errors, maximum %s is greater than value %s"; diff --git a/src/test/java/com/networknt/schema/MinimumValidatorTest.java b/src/test/java/com/networknt/schema/MinimumValidatorTest.java index c43cd653f..329b6040e 100644 --- a/src/test/java/com/networknt/schema/MinimumValidatorTest.java +++ b/src/test/java/com/networknt/schema/MinimumValidatorTest.java @@ -199,7 +199,8 @@ public void negativeDoubleOverflowTest() throws IOException { v = factory.getSchema(bigDecimalMapper.readTree(schema), config); Set messages3 = v.validate(doc); //when the schema and value are both using BigDecimal, the value should be parsed in same mechanism. - if (minimum.toLowerCase().equals(value.toLowerCase()) || Double.valueOf(minimum).equals(Double.NEGATIVE_INFINITY)) { + String theValue = value.toLowerCase().replace("\"", ""); + if (minimum.toLowerCase().equals(theValue)) { assertTrue(messages3.isEmpty(), format("Minimum %s and value %s are equal, thus no schema violation should be reported", minimum, value)); } else { assertFalse(messages3.isEmpty(), format("Minimum %s is larger than value %s , should be validation error reported", minimum, value)); @@ -258,7 +259,9 @@ public void doubleValueCoarsingExceedRange() throws IOException { v = factory.getSchema(bigDecimalMapper.readTree(schema)); messages = v.validate(doc); - assertTrue(messages.isEmpty(), "Validation should succeed due to the bug of BigDecimal option of mapper"); + // Before 2.16.0 messages will be empty due to bug https://github.com/FasterXML/jackson-databind/issues/1770 + //assertTrue(messages.isEmpty(), "Validation should succeed due to the bug of BigDecimal option of mapper"); + assertFalse(messages.isEmpty(), "Validation should fail as Incorrect deserialization for BigDecimal numbers is fixed in 2.16.0"); } private void expectSomeMessages(String[][] values, String number, ObjectMapper mapper, ObjectMapper mapper2) throws IOException {