diff --git a/afterburner/src/test/java/com/fasterxml/jackson/module/afterburner/deser/convert/CoerceFloatToIntTest.java b/afterburner/src/test/java/com/fasterxml/jackson/module/afterburner/deser/convert/CoerceFloatToIntTest.java index b0510c1d0..d51ac643f 100644 --- a/afterburner/src/test/java/com/fasterxml/jackson/module/afterburner/deser/convert/CoerceFloatToIntTest.java +++ b/afterburner/src/test/java/com/fasterxml/jackson/module/afterburner/deser/convert/CoerceFloatToIntTest.java @@ -5,6 +5,7 @@ import java.util.concurrent.atomic.AtomicLong; import com.fasterxml.jackson.core.type.TypeReference; + import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.cfg.CoercionAction; import com.fasterxml.jackson.databind.cfg.CoercionInputShape; @@ -83,7 +84,7 @@ public void testLegacyFailDoubleToInt() throws Exception _verifyCoerceFail(READER_LEGACY_FAIL, Integer.class, "1.5", "java.lang.Integer"); _verifyCoerceFail(READER_LEGACY_FAIL, Integer.TYPE, "1.5", "int"); _verifyCoerceFail(READER_LEGACY_FAIL, IntWrapper.class, "{\"i\":-2.25 }", "int"); - _verifyCoerceFail(READER_LEGACY_FAIL, int[].class, "[ 2.5 ]", "element of `int[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, int[].class, "[ 2.5 ]", "to `int` value"); } public void testLegacyFailDoubleToLong() throws Exception @@ -91,18 +92,18 @@ public void testLegacyFailDoubleToLong() throws Exception _verifyCoerceFail(READER_LEGACY_FAIL, Long.class, "0.5"); _verifyCoerceFail(READER_LEGACY_FAIL, Long.TYPE, "-2.5"); _verifyCoerceFail(READER_LEGACY_FAIL, LongWrapper.class, "{\"l\": 7.7 }"); - _verifyCoerceFail(READER_LEGACY_FAIL, long[].class, "[ -1.35 ]", "element of `long[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, long[].class, "[ -1.35 ]", "to `long` value"); } public void testLegacyFailDoubleToOther() throws Exception { _verifyCoerceFail(READER_LEGACY_FAIL, Short.class, "0.5"); _verifyCoerceFail(READER_LEGACY_FAIL, Short.TYPE, "-2.5"); - _verifyCoerceFail(READER_LEGACY_FAIL, short[].class, "[ -1.35 ]", "element of `short[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, short[].class, "[ -1.35 ]", "to `short` value"); _verifyCoerceFail(READER_LEGACY_FAIL, Byte.class, "0.5"); _verifyCoerceFail(READER_LEGACY_FAIL, Byte.TYPE, "-2.5"); - _verifyCoerceFail(READER_LEGACY_FAIL, byte[].class, "[ -1.35 ]", "element of `byte[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, byte[].class, "[ -1.35 ]", "to `byte` value"); _verifyCoerceFail(READER_LEGACY_FAIL, BigInteger.class, "25236.256"); @@ -286,20 +287,20 @@ public void testCoerceConfigFailFromFloat() throws Exception _verifyCoerceFail(MAPPER_TO_FAIL, Integer.class, "1.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Integer.TYPE, "1.5"); _verifyCoerceFail(MAPPER_TO_FAIL, IntWrapper.class, "{\"i\":-2.25 }", "int"); - _verifyCoerceFail(MAPPER_TO_FAIL, int[].class, "[ 2.5 ]", "element of `int[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, int[].class, "[ 2.5 ]", "to `int` value"); _verifyCoerceFail(MAPPER_TO_FAIL, Long.class, "0.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Long.TYPE, "-2.5"); _verifyCoerceFail(MAPPER_TO_FAIL, LongWrapper.class, "{\"l\": 7.7 }"); - _verifyCoerceFail(MAPPER_TO_FAIL, long[].class, "[ -1.35 ]", "element of `long[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, long[].class, "[ -1.35 ]", "to `long` value"); _verifyCoerceFail(MAPPER_TO_FAIL, Short.class, "0.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Short.TYPE, "-2.5"); - _verifyCoerceFail(MAPPER_TO_FAIL, short[].class, "[ -1.35 ]", "element of `short[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, short[].class, "[ -1.35 ]", "to `short` value"); _verifyCoerceFail(MAPPER_TO_FAIL, Byte.class, "0.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Byte.TYPE, "-2.5"); - _verifyCoerceFail(MAPPER_TO_FAIL, byte[].class, "[ -1.35 ]", "element of `byte[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, byte[].class, "[ -1.35 ]", "to `byte` value"); _verifyCoerceFail(MAPPER_TO_FAIL, BigInteger.class, "25236.256"); } diff --git a/blackbird/src/test/java/com/fasterxml/jackson/module/blackbird/deser/convert/CoerceFloatToIntTest.java b/blackbird/src/test/java/com/fasterxml/jackson/module/blackbird/deser/convert/CoerceFloatToIntTest.java index b31e602d7..49d991e99 100644 --- a/blackbird/src/test/java/com/fasterxml/jackson/module/blackbird/deser/convert/CoerceFloatToIntTest.java +++ b/blackbird/src/test/java/com/fasterxml/jackson/module/blackbird/deser/convert/CoerceFloatToIntTest.java @@ -85,7 +85,7 @@ public void testLegacyFailDoubleToInt() throws Exception _verifyCoerceFail(READER_LEGACY_FAIL, Integer.class, "1.5", "java.lang.Integer"); _verifyCoerceFail(READER_LEGACY_FAIL, Integer.TYPE, "1.5", "int"); _verifyCoerceFail(READER_LEGACY_FAIL, IntWrapper.class, "{\"i\":-2.25 }", "int"); - _verifyCoerceFail(READER_LEGACY_FAIL, int[].class, "[ 2.5 ]", "element of `int[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, int[].class, "[ 2.5 ]", "to `int` value"); } public void testLegacyFailDoubleToLong() throws Exception @@ -93,18 +93,18 @@ public void testLegacyFailDoubleToLong() throws Exception _verifyCoerceFail(READER_LEGACY_FAIL, Long.class, "0.5"); _verifyCoerceFail(READER_LEGACY_FAIL, Long.TYPE, "-2.5"); _verifyCoerceFail(READER_LEGACY_FAIL, LongWrapper.class, "{\"l\": 7.7 }"); - _verifyCoerceFail(READER_LEGACY_FAIL, long[].class, "[ -1.35 ]", "element of `long[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, long[].class, "[ -1.35 ]", "to `long` value"); } public void testLegacyFailDoubleToOther() throws Exception { _verifyCoerceFail(READER_LEGACY_FAIL, Short.class, "0.5"); _verifyCoerceFail(READER_LEGACY_FAIL, Short.TYPE, "-2.5"); - _verifyCoerceFail(READER_LEGACY_FAIL, short[].class, "[ -1.35 ]", "element of `short[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, short[].class, "[ -1.35 ]", "to `short` value"); _verifyCoerceFail(READER_LEGACY_FAIL, Byte.class, "0.5"); _verifyCoerceFail(READER_LEGACY_FAIL, Byte.TYPE, "-2.5"); - _verifyCoerceFail(READER_LEGACY_FAIL, byte[].class, "[ -1.35 ]", "element of `byte[]`"); + _verifyCoerceFail(READER_LEGACY_FAIL, byte[].class, "[ -1.35 ]", "to `byte` value"); _verifyCoerceFail(READER_LEGACY_FAIL, BigInteger.class, "25236.256"); @@ -288,20 +288,20 @@ public void testCoerceConfigFailFromFloat() throws Exception _verifyCoerceFail(MAPPER_TO_FAIL, Integer.class, "1.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Integer.TYPE, "1.5"); _verifyCoerceFail(MAPPER_TO_FAIL, IntWrapper.class, "{\"i\":-2.25 }", "int"); - _verifyCoerceFail(MAPPER_TO_FAIL, int[].class, "[ 2.5 ]", "element of `int[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, int[].class, "[ 2.5 ]", "to `int` value"); _verifyCoerceFail(MAPPER_TO_FAIL, Long.class, "0.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Long.TYPE, "-2.5"); _verifyCoerceFail(MAPPER_TO_FAIL, LongWrapper.class, "{\"l\": 7.7 }"); - _verifyCoerceFail(MAPPER_TO_FAIL, long[].class, "[ -1.35 ]", "element of `long[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, long[].class, "[ -1.35 ]", "to `long` value"); _verifyCoerceFail(MAPPER_TO_FAIL, Short.class, "0.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Short.TYPE, "-2.5"); - _verifyCoerceFail(MAPPER_TO_FAIL, short[].class, "[ -1.35 ]", "element of `short[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, short[].class, "[ -1.35 ]", "to `short` value"); _verifyCoerceFail(MAPPER_TO_FAIL, Byte.class, "0.5"); _verifyCoerceFail(MAPPER_TO_FAIL, Byte.TYPE, "-2.5"); - _verifyCoerceFail(MAPPER_TO_FAIL, byte[].class, "[ -1.35 ]", "element of `byte[]`"); + _verifyCoerceFail(MAPPER_TO_FAIL, byte[].class, "[ -1.35 ]", "to `byte` value"); _verifyCoerceFail(MAPPER_TO_FAIL, BigInteger.class, "25236.256"); }