From a2a7db7a17f592bf97906ad97904b7a3967a5f43 Mon Sep 17 00:00:00 2001 From: "Kim, Joo Hyuk" Date: Sun, 21 Apr 2024 02:48:13 +0900 Subject: [PATCH] Remove remaining `JUnit 4` usage (#4488) --- .../jackson/databind/MapperFootprintTest.java | 11 ++++++----- .../jackson/databind/big/BiggerDataTest.java | 1 + .../jackson/databind/deser/AnySetterTest.java | 1 + .../BeanDeserializerModifier4216Test.java | 2 +- ...elegatingCreatorImplicitNames2543Test.java | 4 ++-- .../deser/jdk/LocaleDeser4009Test.java | 1 + .../deser/jdk/MapKeyDeserializationTest.java | 19 +++++++++---------- .../deser/merge/ArrayNode3338MergeTest.java | 2 ++ .../exc/CustomExceptionDeser4071Test.java | 1 - .../ImmutablesTypeSerializationTest.java | 5 ++--- .../deftyping/TestDefaultWithCreators.java | 3 +-- ...btypesExternalPropertyMissingProperty.java | 4 ++-- .../jsontype/jdk/TypedArrayDeserTest.java | 2 +- .../jsontype/jdk/TypedContainerSerTest.java | 9 ++++----- .../jackson/databind/node/ArrayNodeTest.java | 4 +++- .../databind/node/EmptyContentAsTreeTest.java | 4 ++-- .../node/JsonNodeConversionsTest.java | 14 +++++++------- .../jackson/databind/node/TextNodeTest.java | 2 +- .../databind/seq/PolyMapWriter827Test.java | 3 +-- .../databind/seq/SequenceWriterTest.java | 5 +++++ .../ser/jdk/DateSerializationTest.java | 7 +++---- .../databind/type/TypeBindingsTest.java | 2 +- .../databind/type/TypeFactoryTest.java | 12 ++++++------ .../type/TypeFactoryWithClassLoaderTest.java | 2 +- .../databind/util/ArrayBuildersTest.java | 2 +- .../jackson/databind/util/BeanUtilTest.java | 4 ++-- .../util/BufferRecyclersDatabindTest.java | 2 +- .../databind/util/ByteBufferUtilsTest.java | 2 +- .../jackson/databind/util/ClassUtilTest.java | 2 +- .../util/CompactStringObjectMapTest.java | 4 ++-- .../jackson/databind/util/EnumValuesTest.java | 4 ++-- .../databind/util/ExceptionUtilTest.java | 4 ++-- .../databind/util/ISO8601DateFormatTest.java | 2 +- .../databind/util/ISO8601UtilsTest.java | 4 ++-- .../databind/util/JSONPObjectTest.java | 2 +- .../jackson/databind/util/LRUMapTest.java | 4 ++-- .../databind/util/NameTransformerTest.java | 2 +- .../databind/util/ObjectBufferTest.java | 2 +- .../jackson/databind/util/RawValueTest.java | 2 +- .../databind/util/StdDateFormatTest.java | 3 ++- .../databind/util/TokenBufferTest.java | 4 ++-- .../PrivateMaxEntriesMapStressTest.java | 4 ++-- .../internal/PrivateMaxEntriesMapTest.java | 6 +++--- .../databind/views/DefaultViewTest.java | 2 +- .../views/ViewDeserializationTest.java | 4 ++-- .../views/ViewSerialization2Test.java | 4 ++-- .../databind/views/ViewSerializationTest.java | 4 ++-- .../databind/views/ViewsWithCreatorTest.java | 2 +- .../databind/views/ViewsWithSchemaTest.java | 2 +- .../DeserializerUpdateProperties4358Test.java | 2 +- 50 files changed, 103 insertions(+), 96 deletions(-) diff --git a/src/test/java/com/fasterxml/jackson/databind/MapperFootprintTest.java b/src/test/java/com/fasterxml/jackson/databind/MapperFootprintTest.java index 3f5c35f021..b710f3e1e6 100644 --- a/src/test/java/com/fasterxml/jackson/databind/MapperFootprintTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/MapperFootprintTest.java @@ -1,10 +1,11 @@ package com.fasterxml.jackson.databind; import com.google.common.testing.GcFinalization; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openjdk.jol.info.GraphLayout; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class MapperFootprintTest { /* * Note: this class is run in an isolated execution in surefire. The test is too flaky with all the other tests @@ -28,10 +29,10 @@ public void testMapperFootprint() throws InterruptedException { // 29-Nov-2022, tatu: Should be under 10k, but... flakiness. final int maxByteSize = 20_000; - Assert.assertTrue( + assertTrue( + mapperLayout.totalSize() < maxByteSize, "ObjectMapper memory footprint ("+mapperLayout.totalSize() +") exceeded limit ("+maxByteSize - +"). Footprint details: " + mapperLayout.toFootprint(), - mapperLayout.totalSize() < maxByteSize); + +"). Footprint details: " + mapperLayout.toFootprint()); } } diff --git a/src/test/java/com/fasterxml/jackson/databind/big/BiggerDataTest.java b/src/test/java/com/fasterxml/jackson/databind/big/BiggerDataTest.java index da03d7f8b9..fbe4944d9d 100644 --- a/src/test/java/com/fasterxml/jackson/databind/big/BiggerDataTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/big/BiggerDataTest.java @@ -105,6 +105,7 @@ public void testReading() throws Exception assertEquals(1, citm.venueNames.size()); } + @Test public void testRoundTrip() throws Exception { Citm citm = MAPPER.readValue(getClass().getResourceAsStream("/data/citm_catalog.json"), diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/AnySetterTest.java b/src/test/java/com/fasterxml/jackson/databind/deser/AnySetterTest.java index f08c858481..94dc0a9727 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/AnySetterTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/AnySetterTest.java @@ -496,6 +496,7 @@ public void testAnySetterWithJsonNode() throws Exception } // [databind#4316] + @Test public void testWithAnySetter() throws Exception { Problem4316 problem = new Problem4316(); diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier4216Test.java b/src/test/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier4216Test.java index 20a1eac3cc..fed462a546 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier4216Test.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier4216Test.java @@ -1,6 +1,6 @@ package com.fasterxml.jackson.databind.deser; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.fasterxml.jackson.databind.BeanDescription; import com.fasterxml.jackson.databind.DeserializationConfig; import com.fasterxml.jackson.databind.JsonDeserializer; diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/creators/DelegatingCreatorImplicitNames2543Test.java b/src/test/java/com/fasterxml/jackson/databind/deser/creators/DelegatingCreatorImplicitNames2543Test.java index ffc40a3f48..9cde9c061c 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/creators/DelegatingCreatorImplicitNames2543Test.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/creators/DelegatingCreatorImplicitNames2543Test.java @@ -2,8 +2,6 @@ import java.util.Objects; -import org.junit.Test; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +10,8 @@ import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; +import org.junit.jupiter.api.Test; + import static org.assertj.core.api.Assertions.assertThat; import static com.fasterxml.jackson.annotation.JsonCreator.Mode.DELEGATING; diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/jdk/LocaleDeser4009Test.java b/src/test/java/com/fasterxml/jackson/databind/deser/jdk/LocaleDeser4009Test.java index 1e21b609c6..012aab4f9a 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/jdk/LocaleDeser4009Test.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/jdk/LocaleDeser4009Test.java @@ -15,6 +15,7 @@ public class LocaleDeser4009Test { private final ObjectMapper MAPPER = newJsonMapper(); + @Test public void testLocaleWithFeatureDisabled() throws Exception { assertEquals(Locale.ROOT, diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/jdk/MapKeyDeserializationTest.java b/src/test/java/com/fasterxml/jackson/databind/deser/jdk/MapKeyDeserializationTest.java index efafa8be09..3807b56b59 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/jdk/MapKeyDeserializationTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/jdk/MapKeyDeserializationTest.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.exc.InvalidFormatException; -import org.junit.Assert; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -122,11 +121,11 @@ public void testBooleanMapKeyDeserialization() throws Exception MapWrapper result = MAPPER.readValue(a2q("{'map':{'true':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Boolean.TRUE, result.map.entrySet().iterator().next().getKey()); + assertEquals(Boolean.TRUE, result.map.entrySet().iterator().next().getKey()); result = MAPPER.readValue(a2q("{'map':{'false':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Boolean.FALSE, result.map.entrySet().iterator().next().getKey()); + assertEquals(Boolean.FALSE, result.map.entrySet().iterator().next().getKey()); } @Test @@ -135,7 +134,7 @@ public void testByteMapKeyDeserialization() throws Exception TypeReference> type = new TypeReference>() { }; MapWrapper result = MAPPER.readValue(a2q("{'map':{'13':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Byte.valueOf((byte) 13), result.map.entrySet().iterator().next().getKey()); + assertEquals(Byte.valueOf((byte) 13), result.map.entrySet().iterator().next().getKey()); } @Test @@ -144,7 +143,7 @@ public void testShortMapKeyDeserialization() throws Exception TypeReference> type = new TypeReference>() { }; MapWrapper result = MAPPER.readValue(a2q("{'map':{'13':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Short.valueOf((short) 13), result.map.entrySet().iterator().next().getKey()); + assertEquals(Short.valueOf((short) 13), result.map.entrySet().iterator().next().getKey()); } @Test @@ -153,7 +152,7 @@ public void testIntegerMapKeyDeserialization() throws Exception TypeReference> type = new TypeReference>() { }; MapWrapper result = MAPPER.readValue(a2q("{'map':{'-3':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Integer.valueOf(-3), result.map.entrySet().iterator().next().getKey()); + assertEquals(Integer.valueOf(-3), result.map.entrySet().iterator().next().getKey()); } @Test @@ -162,7 +161,7 @@ public void testLongMapKeyDeserialization() throws Exception TypeReference> type = new TypeReference>() { }; MapWrapper result = MAPPER.readValue(a2q("{'map':{'42':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Long.valueOf(42), result.map.entrySet().iterator().next().getKey()); + assertEquals(Long.valueOf(42), result.map.entrySet().iterator().next().getKey()); } @Test @@ -171,7 +170,7 @@ public void testFloatMapKeyDeserialization() throws Exception TypeReference> type = new TypeReference>() { }; MapWrapper result = MAPPER.readValue(a2q("{'map':{'3.5':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Float.valueOf(3.5f), result.map.entrySet().iterator().next().getKey()); + assertEquals(Float.valueOf(3.5f), result.map.entrySet().iterator().next().getKey()); } @Test @@ -180,7 +179,7 @@ public void testDoubleMapKeyDeserialization() throws Exception TypeReference> type = new TypeReference>() { }; MapWrapper result = MAPPER.readValue(a2q("{'map':{'0.25':'foobar'}}"), type); assertEquals(1, result.map.size()); - Assert.assertEquals(Double.valueOf(0.25), result.map.entrySet().iterator().next().getKey()); + assertEquals(Double.valueOf(0.25), result.map.entrySet().iterator().next().getKey()); } /* @@ -215,7 +214,7 @@ public void testByteArrayMapKeyDeserialization() throws Exception Map.Entry entry = result.map.entrySet().iterator().next(); assertEquals("foobar", entry.getValue()); byte[] key = entry.getKey(); - Assert.assertArrayEquals(binary, key); + assertArrayEquals(binary, key); } // [databind#2725] diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/merge/ArrayNode3338MergeTest.java b/src/test/java/com/fasterxml/jackson/databind/deser/merge/ArrayNode3338MergeTest.java index 6bc26439dd..cba5ed5e68 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/merge/ArrayNode3338MergeTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/merge/ArrayNode3338MergeTest.java @@ -71,6 +71,7 @@ private JsonNode _updateTreeWithArray(ObjectMapper mapper) throws Exception return mapper.readerForUpdating(mergeTarget).readValue(updateNode); } + @Test public void testEnabledObjectNodeMerge() throws Exception { final ObjectMapper mapperWithMerge = sharedMapper(); @@ -91,6 +92,7 @@ public void testEnabledObjectNodeMerge() throws Exception { assertEquals(expected, merged); } + @Test public void testDisabledObjectNodeMerge() throws Exception { ObjectMapper mapperNoObjectMerge = jsonMapperBuilder() .withConfigOverride(ObjectNode.class, diff --git a/src/test/java/com/fasterxml/jackson/databind/exc/CustomExceptionDeser4071Test.java b/src/test/java/com/fasterxml/jackson/databind/exc/CustomExceptionDeser4071Test.java index 580d915420..a78f225c9b 100644 --- a/src/test/java/com/fasterxml/jackson/databind/exc/CustomExceptionDeser4071Test.java +++ b/src/test/java/com/fasterxml/jackson/databind/exc/CustomExceptionDeser4071Test.java @@ -49,7 +49,6 @@ public void testDeserAsThrowable() throws Exception _testDeserAsThrowable(MAPPER.writeValueAsString(new CustomThrowable4071())); } - @Test private void _testDeserAsThrowable(String exStr) throws Exception { assertNotNull(MAPPER.readValue(exStr, Throwable.class)); diff --git a/src/test/java/com/fasterxml/jackson/databind/interop/ImmutablesTypeSerializationTest.java b/src/test/java/com/fasterxml/jackson/databind/interop/ImmutablesTypeSerializationTest.java index e8aed4ae08..6d36314a59 100644 --- a/src/test/java/com/fasterxml/jackson/databind/interop/ImmutablesTypeSerializationTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/interop/ImmutablesTypeSerializationTest.java @@ -14,10 +14,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.junit.jupiter.api.Test; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Tests for serialization and deserialization of objects based on diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/deftyping/TestDefaultWithCreators.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/deftyping/TestDefaultWithCreators.java index dd0e6b6a7f..4e1d3fce17 100644 --- a/src/test/java/com/fasterxml/jackson/databind/jsontype/deftyping/TestDefaultWithCreators.java +++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/deftyping/TestDefaultWithCreators.java @@ -1,6 +1,5 @@ package com.fasterxml.jackson.databind.jsontype.deftyping; -import org.junit.Assert; import org.junit.jupiter.api.Test; import com.fasterxml.jackson.annotation.*; @@ -103,6 +102,6 @@ public void testWithCreatorAndJsonValue() throws Exception assertNotNull(result.value); assertEquals(Bean1385.class, result.value.getClass()); Bean1385 b = (Bean1385) result.value; - Assert.assertArrayEquals(BYTES, b.raw); + assertArrayEquals(BYTES, b.raw); } } diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/ext/TestPropertyCreatorSubtypesExternalPropertyMissingProperty.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/ext/TestPropertyCreatorSubtypesExternalPropertyMissingProperty.java index f88c7f4fd2..fd6ae0f137 100644 --- a/src/test/java/com/fasterxml/jackson/databind/jsontype/ext/TestPropertyCreatorSubtypesExternalPropertyMissingProperty.java +++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/ext/TestPropertyCreatorSubtypesExternalPropertyMissingProperty.java @@ -1,7 +1,5 @@ package com.fasterxml.jackson.databind.jsontype.ext; -import org.junit.Test; - import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.annotation.JsonSubTypes.Type; import com.fasterxml.jackson.annotation.JsonTypeInfo.As; @@ -11,6 +9,8 @@ import com.fasterxml.jackson.databind.exc.MismatchedInputException; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; +import org.junit.jupiter.api.Test; + import static org.junit.jupiter.api.Assertions.*; // for [databind#2404] diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedArrayDeserTest.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedArrayDeserTest.java index 76bdf23660..bbe86a23e9 100644 --- a/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedArrayDeserTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedArrayDeserTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import com.fasterxml.jackson.annotation.*; diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedContainerSerTest.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedContainerSerTest.java index 45eb18d28c..60f85201ca 100644 --- a/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedContainerSerTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/jdk/TypedContainerSerTest.java @@ -2,7 +2,6 @@ import java.util.*; -import org.junit.Assert; import org.junit.jupiter.api.Test; import com.fasterxml.jackson.annotation.*; @@ -116,13 +115,13 @@ public void testPolymorphicWithContainer() throws Exception Container1 c1 = new Container1(); c1.setAnimal(dog); String s1 = mapper.writeValueAsString(c1); - Assert.assertTrue("polymorphic type info is kept (1)", s1 - .indexOf("\"object-type\":\"doggy\"") >= 0); + assertTrue(s1.indexOf("\"object-type\":\"doggy\"") >= 0, + "polymorphic type info is kept (1)"); Container2 c2 = new Container2(); c2.setAnimal(dog); String s2 = mapper.writeValueAsString(c2); - Assert.assertTrue("polymorphic type info is kept (2)", s2 - .indexOf("\"object-type\":\"doggy\"") >= 0); + assertTrue(s2.indexOf("\"object-type\":\"doggy\"") >= 0, + "polymorphic type info is kept (2)"); } @Test diff --git a/src/test/java/com/fasterxml/jackson/databind/node/ArrayNodeTest.java b/src/test/java/com/fasterxml/jackson/databind/node/ArrayNodeTest.java index e941f76515..2dab58f6cc 100644 --- a/src/test/java/com/fasterxml/jackson/databind/node/ArrayNodeTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/node/ArrayNodeTest.java @@ -10,10 +10,12 @@ import com.fasterxml.jackson.databind.exc.MismatchedInputException; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; import com.fasterxml.jackson.databind.util.RawValue; + import org.junit.jupiter.api.Test; import static java.util.Arrays.asList; -import static org.junit.Assert.*; + +import static org.junit.jupiter.api.Assertions.*; /** * Additional tests for {@link ArrayNode} container class. diff --git a/src/test/java/com/fasterxml/jackson/databind/node/EmptyContentAsTreeTest.java b/src/test/java/com/fasterxml/jackson/databind/node/EmptyContentAsTreeTest.java index 8ab1c6729d..423f8ea754 100644 --- a/src/test/java/com/fasterxml/jackson/databind/node/EmptyContentAsTreeTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/node/EmptyContentAsTreeTest.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; /** @@ -135,7 +135,7 @@ private void _assertNullTree(TreeNode n) { } private void _assertMissing(JsonNode n) { - assertNotNull("Should not get `null` but `MissingNode`", n); + assertNotNull(n, "Should not get `null` but `MissingNode`"); if (!n.isMissingNode()) { fail("Should get `MissingNode` but got: "+n.getClass().getName()); } diff --git a/src/test/java/com/fasterxml/jackson/databind/node/JsonNodeConversionsTest.java b/src/test/java/com/fasterxml/jackson/databind/node/JsonNodeConversionsTest.java index 849fa3949c..7a1c55a3ce 100644 --- a/src/test/java/com/fasterxml/jackson/databind/node/JsonNodeConversionsTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/node/JsonNodeConversionsTest.java @@ -6,11 +6,10 @@ import java.util.*; import java.util.concurrent.atomic.AtomicReference; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import org.junit.Assert; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.core.*; @@ -272,9 +271,9 @@ public void testIssue709() throws Exception Issue709Bean resultFromConvert = MAPPER.convertValue(node, Issue709Bean.class); // all methods should work equally well: - Assert.assertArrayEquals(inputData, resultFromString.data); - Assert.assertArrayEquals(inputData, resultFromConvert.data); - Assert.assertArrayEquals(inputData, result.data); + assertArrayEquals(inputData, resultFromString.data); + assertArrayEquals(inputData, resultFromConvert.data); + assertArrayEquals(inputData, result.data); } @Test @@ -328,7 +327,7 @@ public void testConversionOfPojos() throws Exception // then via conversions: should become JSON Object JsonNode tree = MAPPER.valueToTree(input); - assertTrue("Expected Object, got "+tree.getNodeType(), tree.isObject()); + assertTrue(tree.isObject(), "Expected Object, got "+tree.getNodeType()); assertEquals(EXP, MAPPER.writeValueAsString(tree)); } @@ -345,7 +344,8 @@ public void testConversionOfTrees() throws Exception // then via conversions: should become JSON Object JsonNode tree = MAPPER.valueToTree(input); - assertTrue("Expected Object, got "+tree.getNodeType(), tree.isBoolean()); + assertTrue(tree.isBoolean(), + "Expected Object, got "+tree.getNodeType()); assertEquals(EXP, MAPPER.writeValueAsString(tree)); } diff --git a/src/test/java/com/fasterxml/jackson/databind/node/TextNodeTest.java b/src/test/java/com/fasterxml/jackson/databind/node/TextNodeTest.java index 50bd0b45a4..3aa9e9eaae 100644 --- a/src/test/java/com/fasterxml/jackson/databind/node/TextNodeTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/node/TextNodeTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.*; diff --git a/src/test/java/com/fasterxml/jackson/databind/seq/PolyMapWriter827Test.java b/src/test/java/com/fasterxml/jackson/databind/seq/PolyMapWriter827Test.java index 0ad26f5679..4b1b598d86 100644 --- a/src/test/java/com/fasterxml/jackson/databind/seq/PolyMapWriter827Test.java +++ b/src/test/java/com/fasterxml/jackson/databind/seq/PolyMapWriter827Test.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Assert; import org.junit.jupiter.api.Test; import com.fasterxml.jackson.core.JsonGenerator; @@ -52,6 +51,6 @@ public void testPolyCustomKeySerializer() throws Exception final ObjectWriter writer = mapper.writerFor(new TypeReference>() { }); String json = writer.writeValueAsString(map); - Assert.assertEquals("[\"java.util.HashMap\",{\"foo,1\":\"bar\"}]", json); + assertEquals("[\"java.util.HashMap\",{\"foo,1\":\"bar\"}]", json); } } diff --git a/src/test/java/com/fasterxml/jackson/databind/seq/SequenceWriterTest.java b/src/test/java/com/fasterxml/jackson/databind/seq/SequenceWriterTest.java index 44335ebbdd..8389f60082 100644 --- a/src/test/java/com/fasterxml/jackson/databind/seq/SequenceWriterTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/seq/SequenceWriterTest.java @@ -145,6 +145,7 @@ public void testSimpleNonArrayNoSeparator() throws Exception // will not work in 2.x. } + @Test public void testSimpleArray() throws Exception { StringWriter strw = new StringWriter(); @@ -176,6 +177,7 @@ public void testSimpleArray() throws Exception */ @SuppressWarnings("resource") + @Test public void testPolymorphicNonArrayWithoutType() throws Exception { StringWriter strw = new StringWriter(); @@ -189,6 +191,7 @@ public void testPolymorphicNonArrayWithoutType() throws Exception } @SuppressWarnings("resource") + @Test public void testPolymorphicArrayWithoutType() throws Exception { StringWriter strw = new StringWriter(); @@ -201,6 +204,7 @@ public void testPolymorphicArrayWithoutType() throws Exception strw.toString()); } + @Test public void testPolymorphicArrayWithType() throws Exception { StringWriter strw = new StringWriter(); @@ -217,6 +221,7 @@ public void testPolymorphicArrayWithType() throws Exception } @SuppressWarnings("resource") + @Test public void testSimpleCloseable() throws Exception { JsonMapper mapper = JsonMapper.builder().enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY).build(); diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/jdk/DateSerializationTest.java b/src/test/java/com/fasterxml/jackson/databind/ser/jdk/DateSerializationTest.java index 6a309fbb75..43de7b6917 100644 --- a/src/test/java/com/fasterxml/jackson/databind/ser/jdk/DateSerializationTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/ser/jdk/DateSerializationTest.java @@ -5,7 +5,6 @@ import java.text.SimpleDateFormat; import java.util.*; -import org.junit.Assert; import org.junit.jupiter.api.Test; import com.fasterxml.jackson.annotation.JsonFormat; @@ -15,7 +14,7 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; import com.fasterxml.jackson.databind.util.StdDateFormat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -392,11 +391,11 @@ private static Date judate(int year, int month, int day, int hour, int minutes, } private void serialize(ObjectMapper mapper, Object date, String expected) throws IOException { - Assert.assertEquals(q(expected), mapper.writeValueAsString(date)); + assertEquals(q(expected), mapper.writeValueAsString(date)); } private void serialize(ObjectWriter w, Object date, String expected) throws IOException { - Assert.assertEquals(q(expected), w.writeValueAsString(date)); + assertEquals(q(expected), w.writeValueAsString(date)); } private String zoneOffset(String raw) { diff --git a/src/test/java/com/fasterxml/jackson/databind/type/TypeBindingsTest.java b/src/test/java/com/fasterxml/jackson/databind/type/TypeBindingsTest.java index 420d0c567f..7ae39b11fb 100644 --- a/src/test/java/com/fasterxml/jackson/databind/type/TypeBindingsTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/type/TypeBindingsTest.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.JavaType; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.*; import static com.fasterxml.jackson.databind.testutil.DatabindTestUtil.verifyException; diff --git a/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryTest.java b/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryTest.java index 234d171002..9b992d7ebb 100644 --- a/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryTest.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.*; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.*; import static com.fasterxml.jackson.databind.testutil.DatabindTestUtil.newTypeFactory; @@ -505,9 +505,9 @@ public void testMapsHashCode() JavaType mapIntString = tf.constructType(new TypeReference>() {}); assertNotEquals(mapStringInt, mapIntString); assertNotEquals( - "hashCode should depend on parameter order", mapStringInt.hashCode(), - mapIntString.hashCode()); + mapIntString.hashCode(), + "hashCode should depend on parameter order"); JavaType mapStringString = tf.constructType(new TypeReference>() {}); JavaType mapIntInt = tf.constructType(new TypeReference>() {}); @@ -821,8 +821,8 @@ public void testParameterizedSimpleType() { assertNotEquals(charSequenceClass, numberClass); assertNotEquals( - "hash values should be distributed", - charSequenceClass.hashCode(), numberClass.hashCode()); + charSequenceClass.hashCode(), numberClass.hashCode(), + "hash values should be distributed"); } private void assertEqualsAndHash(JavaType t1, JavaType t2) { diff --git a/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryWithClassLoaderTest.java b/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryWithClassLoaderTest.java index e7c1f6ddae..08748f83bd 100644 --- a/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryWithClassLoaderTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/type/TypeFactoryWithClassLoaderTest.java @@ -59,7 +59,7 @@ public void testUsesCorrectClassLoaderWhenThreadClassLoaderIsNotNull() throws Cl verify(spySut).classForName(any(String.class), any(Boolean.class), eq(classLoader)); assertNotNull(clazz); assertEquals(classLoader, spySut.getClassLoader()); -// Assert.assertEquals(typeModifier,spySut._modifiers[0]); +// assertEquals(typeModifier,spySut._modifiers[0]); } @Test diff --git a/src/test/java/com/fasterxml/jackson/databind/util/ArrayBuildersTest.java b/src/test/java/com/fasterxml/jackson/databind/util/ArrayBuildersTest.java index 60969c24c0..4b928ba31e 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/ArrayBuildersTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/ArrayBuildersTest.java @@ -14,7 +14,7 @@ import com.fasterxml.jackson.databind.util.ArrayBuilders.LongBuilder; import com.fasterxml.jackson.databind.util.ArrayBuilders.ShortBuilder; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class ArrayBuildersTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/BeanUtilTest.java b/src/test/java/com/fasterxml/jackson/databind/util/BeanUtilTest.java index 13b116d535..c73bd93952 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/BeanUtilTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/BeanUtilTest.java @@ -10,8 +10,8 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; import com.fasterxml.jackson.databind.type.TypeFactory; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class BeanUtilTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/BufferRecyclersDatabindTest.java b/src/test/java/com/fasterxml/jackson/databind/util/BufferRecyclersDatabindTest.java index 1e6dd55c13..f867f8938e 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/BufferRecyclersDatabindTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/BufferRecyclersDatabindTest.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; // For [databind#4321]: basic test public class BufferRecyclersDatabindTest extends DatabindTestUtil diff --git a/src/test/java/com/fasterxml/jackson/databind/util/ByteBufferUtilsTest.java b/src/test/java/com/fasterxml/jackson/databind/util/ByteBufferUtilsTest.java index b9c54a30fd..186b340e3a 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/ByteBufferUtilsTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/ByteBufferUtilsTest.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; import com.fasterxml.jackson.databind.testutil.FiveMinuteUser; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ByteBufferUtilsTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/ClassUtilTest.java b/src/test/java/com/fasterxml/jackson/databind/util/ClassUtilTest.java index c7bb0b6530..6181c5ae4a 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/ClassUtilTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/ClassUtilTest.java @@ -15,7 +15,7 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; import com.fasterxml.jackson.databind.type.TypeFactory; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class ClassUtilTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/CompactStringObjectMapTest.java b/src/test/java/com/fasterxml/jackson/databind/util/CompactStringObjectMapTest.java index 1a0cd325a2..3fec8fc0da 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/CompactStringObjectMapTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/CompactStringObjectMapTest.java @@ -6,8 +6,8 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class CompactStringObjectMapTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/EnumValuesTest.java b/src/test/java/com/fasterxml/jackson/databind/util/EnumValuesTest.java index 5ed8430609..484396abbb 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/EnumValuesTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/EnumValuesTest.java @@ -10,8 +10,8 @@ import com.fasterxml.jackson.databind.introspect.AnnotatedClassResolver; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class EnumValuesTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/ExceptionUtilTest.java b/src/test/java/com/fasterxml/jackson/databind/util/ExceptionUtilTest.java index c8bc922c85..7c4af19942 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/ExceptionUtilTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/ExceptionUtilTest.java @@ -4,8 +4,8 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; public class ExceptionUtilTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/ISO8601DateFormatTest.java b/src/test/java/com/fasterxml/jackson/databind/util/ISO8601DateFormatTest.java index f6a0e23435..ead4fa2b35 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/ISO8601DateFormatTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/ISO8601DateFormatTest.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; @SuppressWarnings("deprecation") public class ISO8601DateFormatTest extends DatabindTestUtil diff --git a/src/test/java/com/fasterxml/jackson/databind/util/ISO8601UtilsTest.java b/src/test/java/com/fasterxml/jackson/databind/util/ISO8601UtilsTest.java index e018ee7603..113b488036 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/ISO8601UtilsTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/ISO8601UtilsTest.java @@ -13,8 +13,8 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; @SuppressWarnings("deprecation") public class ISO8601UtilsTest extends DatabindTestUtil diff --git a/src/test/java/com/fasterxml/jackson/databind/util/JSONPObjectTest.java b/src/test/java/com/fasterxml/jackson/databind/util/JSONPObjectTest.java index 22808cbb38..7a918f9e77 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/JSONPObjectTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/JSONPObjectTest.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class JSONPObjectTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/LRUMapTest.java b/src/test/java/com/fasterxml/jackson/databind/util/LRUMapTest.java index 3af9685936..1de9801e32 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/LRUMapTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/LRUMapTest.java @@ -4,8 +4,8 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class LRUMapTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/NameTransformerTest.java b/src/test/java/com/fasterxml/jackson/databind/util/NameTransformerTest.java index dab136199c..5d9e864d86 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/NameTransformerTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/NameTransformerTest.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class NameTransformerTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/ObjectBufferTest.java b/src/test/java/com/fasterxml/jackson/databind/util/ObjectBufferTest.java index 19c8f4ab96..d267ba9744 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/ObjectBufferTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/ObjectBufferTest.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ObjectBufferTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/RawValueTest.java b/src/test/java/com/fasterxml/jackson/databind/util/RawValueTest.java index 3b76c6022e..0fc772e41b 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/RawValueTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/RawValueTest.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.JsonSerializable; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class RawValueTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/StdDateFormatTest.java b/src/test/java/com/fasterxml/jackson/databind/util/StdDateFormatTest.java index 09886d28c1..0433a6eb45 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/StdDateFormatTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/StdDateFormatTest.java @@ -9,11 +9,12 @@ import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class StdDateFormatTest extends DatabindTestUtil { @SuppressWarnings("deprecation") + @Test public void testFactories() { TimeZone tz = TimeZone.getTimeZone("GMT"); Locale loc = Locale.US; diff --git a/src/test/java/com/fasterxml/jackson/databind/util/TokenBufferTest.java b/src/test/java/com/fasterxml/jackson/databind/util/TokenBufferTest.java index 66456080eb..6bc0689ba1 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/TokenBufferTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/TokenBufferTest.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.databind.ser.std.StdSerializer; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; @SuppressWarnings("resource") public class TokenBufferTest extends DatabindTestUtil @@ -90,7 +90,7 @@ public void testParserFeatureDefaults() throws IOException TokenBuffer buf = new TokenBuffer(MAPPER, false); try (JsonParser p = buf.asParser()) { for (JsonParser.Feature feat : JsonParser.Feature.values()) { - assertEquals("Feature "+feat, feat.enabledByDefault(), p.isEnabled(feat)); + assertEquals(feat.enabledByDefault(), p.isEnabled(feat), "Feature "+feat); } } } diff --git a/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapStressTest.java b/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapStressTest.java index 1d0d0cbcde..205695a9da 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapStressTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapStressTest.java @@ -1,6 +1,6 @@ package com.fasterxml.jackson.databind.util.internal; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -12,7 +12,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class PrivateMaxEntriesMapStressTest { diff --git a/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapTest.java b/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapTest.java index eccb9e86d3..236296ed12 100644 --- a/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/util/internal/PrivateMaxEntriesMapTest.java @@ -18,10 +18,10 @@ ****************************************************************/ package com.fasterxml.jackson.databind.util.internal; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; //copied from https://github.com/apache/cayenne/blob/b156addac1c8e4079fa88e977fee609210c5da69/cayenne-server/src/test/java/org/apache/cayenne/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java public class PrivateMaxEntriesMapTest { diff --git a/src/test/java/com/fasterxml/jackson/databind/views/DefaultViewTest.java b/src/test/java/com/fasterxml/jackson/databind/views/DefaultViewTest.java index 9dcd9eee98..980e593733 100644 --- a/src/test/java/com/fasterxml/jackson/databind/views/DefaultViewTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/views/DefaultViewTest.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; // for [databind#507], supporting default views public class DefaultViewTest extends DatabindTestUtil diff --git a/src/test/java/com/fasterxml/jackson/databind/views/ViewDeserializationTest.java b/src/test/java/com/fasterxml/jackson/databind/views/ViewDeserializationTest.java index 636bacbbd3..90bdda978f 100644 --- a/src/test/java/com/fasterxml/jackson/databind/views/ViewDeserializationTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/views/ViewDeserializationTest.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; public class ViewDeserializationTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/views/ViewSerialization2Test.java b/src/test/java/com/fasterxml/jackson/databind/views/ViewSerialization2Test.java index abed5e4b0e..6d1c4ee507 100644 --- a/src/test/java/com/fasterxml/jackson/databind/views/ViewSerialization2Test.java +++ b/src/test/java/com/fasterxml/jackson/databind/views/ViewSerialization2Test.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ViewSerialization2Test extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/views/ViewSerializationTest.java b/src/test/java/com/fasterxml/jackson/databind/views/ViewSerializationTest.java index cd60dca6c6..8a481a7e98 100644 --- a/src/test/java/com/fasterxml/jackson/databind/views/ViewSerializationTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/views/ViewSerializationTest.java @@ -10,8 +10,8 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; /** * Unit tests for verifying JSON view functionality: ability to declaratively diff --git a/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithCreatorTest.java b/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithCreatorTest.java index 0b223a6e59..f557e2f97c 100644 --- a/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithCreatorTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithCreatorTest.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ViewsWithCreatorTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithSchemaTest.java b/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithSchemaTest.java index 9f0944596c..1fc23fb1eb 100644 --- a/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithSchemaTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/views/ViewsWithSchemaTest.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.databind.jsonFormatVisitors.*; import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ViewsWithSchemaTest extends DatabindTestUtil { diff --git a/src/test/java/com/fasterxml/jackson/failing/DeserializerUpdateProperties4358Test.java b/src/test/java/com/fasterxml/jackson/failing/DeserializerUpdateProperties4358Test.java index adccb81921..fa5b2ec7eb 100644 --- a/src/test/java/com/fasterxml/jackson/failing/DeserializerUpdateProperties4358Test.java +++ b/src/test/java/com/fasterxml/jackson/failing/DeserializerUpdateProperties4358Test.java @@ -109,7 +109,7 @@ public String deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx final ObjectMapper modifiedObjectMapper = jsonMapperBuilder().addModules(getSimpleModuleWithDeserializerModifier()).build(); @BeforeAll - void setUp() { + static void setUp() { actualOrder.clear(); }