diff --git a/guava/pom.xml b/guava/pom.xml
index 9335f6b1..d9e78e49 100644
--- a/guava/pom.xml
+++ b/guava/pom.xml
@@ -53,10 +53,15 @@ com.google.common.*;version="${version.guava.osgi}",
${version.guava}
-
+
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-api
test
diff --git a/guava/src/main/java/module-info.java b/guava/src/main/java/module-info.java
index 0487306e..20b13047 100644
--- a/guava/src/main/java/module-info.java
+++ b/guava/src/main/java/module-info.java
@@ -4,7 +4,7 @@
requires com.fasterxml.jackson.annotation;
requires tools.jackson.core;
- requires tools.jackson.databind;
+ requires transitive tools.jackson.databind;
requires com.google.common;
diff --git a/guava/src/test/java/module-info.java b/guava/src/test/java/module-info.java
index 3fa4ca62..608801cb 100644
--- a/guava/src/test/java/module-info.java
+++ b/guava/src/test/java/module-info.java
@@ -12,7 +12,8 @@
requires com.google.common;
// Additional test lib/framework dependencies
- requires junit; // JUnit 4
+ requires org.junit.jupiter.api;
+ requires org.junit.jupiter.params;
// Further, need to open up test packages for JUnit et al
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/CacheDeserializationTest.java b/guava/src/test/java/tools/jackson/datatype/guava/CacheDeserializationTest.java
index d32c1b95..0872394c 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/CacheDeserializationTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/CacheDeserializationTest.java
@@ -3,6 +3,8 @@
import java.util.Map;
import java.util.Objects;
+import org.junit.jupiter.api.Test;
+
import com.google.common.base.Optional;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
@@ -16,6 +18,8 @@
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.exc.MismatchedInputException;
+import static org.junit.jupiter.api.Assertions.*;
+
/**
* Unit tests for verifying deserialization of Guava's {@link Cache} type.
*
@@ -68,6 +72,7 @@ static class CacheWrapper {
private final ObjectMapper MAPPER = mapperWithModule();
+ @Test
public void testGuavaCacheApi() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
// Cache does not allow null key
@@ -83,6 +88,7 @@ public void testGuavaCacheApi() throws Exception {
} catch (NullPointerException e) {}
}
+ @Test
public void testCacheDeserializationSimple() throws Exception {
// Create a delegate cache using CacheBuilder
Cache delegateCache = CacheBuilder.newBuilder().build();
@@ -95,6 +101,7 @@ public void testCacheDeserializationSimple() throws Exception {
assertEquals("foo", s.getIfPresent("a"));
}
+ @Test
public void testCacheDeserRoundTrip() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
cache.put("key1", 1);
@@ -111,6 +118,7 @@ public void testCacheDeserRoundTrip() throws Exception {
}
// [datatype-collections#96]
+ @Test
public void testCacheSerialization() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
cache.put(1L, 1);
@@ -134,6 +142,7 @@ private void _verifySizeTwoAndContains(Map map) {
assertEquals(2, map.get(2L).intValue());
}
+ @Test
public void testEnumKey() throws Exception {
final TypeReference> type = new TypeReference>() {};
final Cache cache = CacheBuilder.newBuilder().build();
@@ -151,11 +160,13 @@ public void testEnumKey() throws Exception {
deserializedCache.asMap().entrySet());
}
+ @Test
public void testEmptyCacheExclusion() throws Exception {
String json = MAPPER.writeValueAsString(new CacheWrapper());
assertEquals("{}", json);
}
+ @Test
public void testWithGuavaOptional() throws Exception {
// set up
Cache> cache = CacheBuilder.newBuilder().build();
@@ -175,6 +186,7 @@ public void testWithGuavaOptional() throws Exception {
}
// [datatypes-collections#140]: handle null values
+ @Test
public void testCacheWithNulls() throws Exception {
Cache cache;
try {
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/CacheSerializationTest.java b/guava/src/test/java/tools/jackson/datatype/guava/CacheSerializationTest.java
index b27d78df..c21da610 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/CacheSerializationTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/CacheSerializationTest.java
@@ -10,10 +10,13 @@
import com.google.common.base.Objects;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
+import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
+import static org.junit.jupiter.api.Assertions.*;
+
/**
* Unit tests for verifying serialization of Guava's {@link Cache} type.
*/
@@ -191,6 +194,7 @@ public String toString() {
.enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS)
.build();
+ @Test
public void testGuavaCacheApi() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
// Cache does not allow null key
@@ -206,6 +210,7 @@ public void testGuavaCacheApi() throws Exception {
} catch (NullPointerException e) {}
}
+ @Test
public void testCacheSerialization() throws Exception {
// Create a Guava Cache
Cache cache = CacheBuilder.newBuilder().build();
@@ -217,6 +222,7 @@ public void testCacheSerialization() throws Exception {
ORDERED_MAPPER.writeValueAsString(cache));
}
+ @Test
public void testCacheSerializationIgnoreProperties() throws Exception {
CacheContainerWithIgnores container = new CacheContainerWithIgnores();
@@ -225,6 +231,7 @@ public void testCacheSerializationIgnoreProperties() throws Exception {
ORDERED_MAPPER.writeValueAsString(container));
}
+ @Test
public void testCacheSerializationWithBean() throws Exception {
CacheContainerWithBean container = new CacheContainerWithBean();
@@ -233,6 +240,7 @@ public void testCacheSerializationWithBean() throws Exception {
ORDERED_MAPPER.writeValueAsString(container));
}
+ @Test
public void testCacheSerializationWithList() throws Exception {
CacheContainerWithList container = new CacheContainerWithList();
@@ -241,6 +249,7 @@ public void testCacheSerializationWithList() throws Exception {
ORDERED_MAPPER.writeValueAsString(container));
}
+ @Test
public void testCacheSerializationWithEmptyCache() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
@@ -249,6 +258,7 @@ public void testCacheSerializationWithEmptyCache() throws Exception {
ORDERED_MAPPER.writeValueAsString(cache));
}
+ @Test
public void testCacheSerializationBeanKey() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
cache.put(new BeanKey(1), "value1");
@@ -258,6 +268,7 @@ public void testCacheSerializationBeanKey() throws Exception {
ORDERED_MAPPER.writeValueAsString(cache));
}
+ @Test
public void testCacheSerializationBeanKeyEquals() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
cache.put(new BeanKeyEquals(1), "value1");
@@ -270,12 +281,14 @@ public void testCacheSerializationBeanKeyEquals() throws Exception {
}
+ @Test
public void testEmptyCacheExclusion() throws Exception {
String json = ORDERED_MAPPER.writeValueAsString(new CacheWrapper());
assertEquals("{}", json);
}
+ @Test
public void testCacheSerializationWithTypeReference() throws Exception {
final Cache cache = CacheBuilder.newBuilder().build();
cache.put(MyEnum.YAY, 5);
@@ -289,6 +302,7 @@ public void testCacheSerializationWithTypeReference() throws Exception {
assertEquals(expected, mapperSer);
}
+ @Test
public void testOrderByKeyViaProperty() throws Exception {
CacheOrderingBean input = new CacheOrderingBean("c", "b", "a");
@@ -297,6 +311,7 @@ public void testOrderByKeyViaProperty() throws Exception {
assertEquals(a2q("{'cache':{'a':3,'b':2,'c':1}}"), json);
}
+ @Test
public void testPolymorphicCacheSerialization() throws Exception {
Cache cache = CacheBuilder.newBuilder().build();
cache.put("c", new Cat());
@@ -311,6 +326,7 @@ public void testPolymorphicCacheSerialization() throws Exception {
"'d':{'_type':'t_dog','name':'Woof'}}}"), json);
}
+ @Test
public void testNestedCacheSerialization() throws Exception {
Cache> nestedCache = CacheBuilder.newBuilder().build();
nestedCache.put("a", _buildCacheWithKeys("a_x", "a_y"));
@@ -333,6 +349,7 @@ private Cache _buildCacheWithKeys(String... keys) {
}
// [datatypes-collections#104]
+ @Test
public void testPolymorphicCacheEmpty() throws Exception {
final Cache cache = CacheBuilder.newBuilder().build();
cache.put("aKey", 1);
@@ -340,6 +357,7 @@ public void testPolymorphicCacheEmpty() throws Exception {
a2q("{'aProperty':{'@type':'LocalCache$LocalManualCache','aKey':1}}"));
}
+ @Test
public void testPolymorphicCacheNonEmpty() throws Exception {
_testPolymorphicCache(CacheBuilder.newBuilder().build(),
a2q("{'aProperty':{'@type':'LocalCache$LocalManualCache'}}"));
@@ -354,6 +372,7 @@ private void _testPolymorphicCache(Cache cache, String expected)
assertEquals(expected, json);
}
+ @Test
public void testCacheSerializeOrderedByKey() throws Exception {
final Cache cache = _buildCacheWithKeys("c_key", "d_key", "a_key", "e_key", "b_key");
@@ -365,6 +384,7 @@ public void testCacheSerializeOrderedByKey() throws Exception {
new TypeReference>() {}).writeValueAsString(cache));
}
+ @Test
public void testPolymorphicCacheWrapperSerialization() throws Exception {
final Cache cache = _buildCacheWithKeys("c_key", "a_key", "e_key", "b_key", "d_key");
PolymorphicWrapperBean outside = new PolymorphicWrapperBean();
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/EmptyCollectionsTest.java b/guava/src/test/java/tools/jackson/datatype/guava/EmptyCollectionsTest.java
index 1ca6e3b4..11163e8a 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/EmptyCollectionsTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/EmptyCollectionsTest.java
@@ -1,11 +1,15 @@
package tools.jackson.datatype.guava;
+import org.junit.jupiter.api.Test;
+
import com.fasterxml.jackson.annotation.Nulls;
import tools.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import static org.junit.jupiter.api.Assertions.*;
+
public class EmptyCollectionsTest extends ModuleTestBase
{
// [datatypes-collections#67]
@@ -24,6 +28,7 @@ public static class ImmutableMapContainer67 {
.build();
// [datatypes-collections#67]
+ @Test
public void testEmptyForLists() throws Exception
{
ImmutableListContainer67 result;
@@ -47,6 +52,7 @@ public void testEmptyForLists() throws Exception
assertEquals(0, result.lists.size());
}
+ @Test
public void testEmptyForMaps() throws Exception
{
ImmutableMapContainer67 result;
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/FluentIterableTest.java b/guava/src/test/java/tools/jackson/datatype/guava/FluentIterableTest.java
index 2cbf9276..1221bcc6 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/FluentIterableTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/FluentIterableTest.java
@@ -2,10 +2,14 @@
import java.util.Arrays;
+import org.junit.jupiter.api.Test;
+
import com.google.common.collect.FluentIterable;
import tools.jackson.databind.ObjectMapper;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
/**
* Unit tests to verify serialization of {@link FluentIterable}s.
*/
@@ -27,6 +31,7 @@ static FluentIterable createFluentIterable() {
* or Guava's implementation of FluentIterable changes.
* @throws Exception
*/
+ @Test
public void testSerializationWithoutModule() throws Exception {
ObjectMapper mapper = new ObjectMapper();
FluentHolder holder = new FluentHolder();
@@ -34,15 +39,16 @@ public void testSerializationWithoutModule() throws Exception {
assertEquals("{\"value\":{\"empty\":false}}", json);
}
+ @Test
public void testSerialization() throws Exception {
String json = MAPPER.writeValueAsString(createFluentIterable());
assertEquals("[1,2,3]", json);
}
+ @Test
public void testWrappedSerialization() throws Exception {
FluentHolder holder = new FluentHolder();
String json = MAPPER.writeValueAsString(holder);
assertEquals("{\"value\":[1,2,3]}", json);
}
-
}
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/HashCodeTest.java b/guava/src/test/java/tools/jackson/datatype/guava/HashCodeTest.java
index a4d2cfbd..728e61de 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/HashCodeTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/HashCodeTest.java
@@ -1,14 +1,19 @@
package tools.jackson.datatype.guava;
+import org.junit.jupiter.api.Test;
+
+import com.google.common.hash.HashCode;
+
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.exc.MismatchedInputException;
-import com.google.common.hash.HashCode;
+import static org.junit.jupiter.api.Assertions.*;
public class HashCodeTest extends ModuleTestBase
{
private final ObjectMapper MAPPER = mapperWithModule();
+ @Test
public void testSerialization() throws Exception
{
HashCode input = HashCode.fromString("cafebabe12345678");
@@ -16,6 +21,7 @@ public void testSerialization() throws Exception
assertEquals("\"cafebabe12345678\"", json);
}
+ @Test
public void testDeserialization() throws Exception
{
// success:
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/HostAndPortTest.java b/guava/src/test/java/tools/jackson/datatype/guava/HostAndPortTest.java
index e331ea1c..9e375e14 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/HostAndPortTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/HostAndPortTest.java
@@ -1,14 +1,19 @@
package tools.jackson.datatype.guava;
+import org.junit.jupiter.api.Test;
+
+import com.google.common.net.HostAndPort;
+
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.exc.MismatchedInputException;
-import com.google.common.net.HostAndPort;
+import static org.junit.jupiter.api.Assertions.*;
public class HostAndPortTest extends ModuleTestBase
{
private final ObjectMapper MAPPER = mapperWithModule();
+ @Test
public void testSerialization() throws Exception
{
HostAndPort input = HostAndPort.fromParts("localhost", 80);
@@ -16,6 +21,7 @@ public void testSerialization() throws Exception
assertEquals("\"localhost:80\"", json);
}
+ @Test
public void testDeserializationOk() throws Exception
{
// Actually, let's support both old style and new style
@@ -44,6 +50,7 @@ public void testDeserializationOk() throws Exception
assertEquals(HostAndPort.fromHost(""), result);
}
+ @Test
public void testDeserializationFail() throws Exception
{
HostAndPort result = null;
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/ImmutableContainersTest.java b/guava/src/test/java/tools/jackson/datatype/guava/ImmutableContainersTest.java
index 380956c7..1e26c621 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/ImmutableContainersTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/ImmutableContainersTest.java
@@ -2,6 +2,8 @@
import java.util.Iterator;
+import org.junit.jupiter.api.Test;
+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import tools.jackson.core.type.TypeReference;
@@ -14,6 +16,8 @@
import com.google.common.collect.*;
+import static org.junit.jupiter.api.Assertions.*;
+
/**
* Unit tests for verifying that various immutable types
* (like {@link ImmutableList}, {@link ImmutableMap} and {@link ImmutableSet})
@@ -53,6 +57,7 @@ public PolymorphicHolder(Object v) {
* Immutable types can actually be serialized as regular collections, without
* problems.
*/
+ @Test
public void testWithoutSerializers() throws Exception
{
ImmutableList list = ImmutableList.builder()
@@ -79,6 +84,7 @@ public void testWithoutSerializers() throws Exception
/**
* Deserialization will fail, however.
*/
+ @Test
public void testWithoutDeserializersFail() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
@@ -126,6 +132,7 @@ private void _verifyImmutableException(InvalidDefinitionException e, Class> ty
/**********************************************************************
*/
+ @Test
public void testImmutableList() throws Exception
{
ImmutableList list = MAPPER.readValue("[1,2,3]", new TypeReference>() { });
@@ -135,6 +142,7 @@ public void testImmutableList() throws Exception
assertEquals(Integer.valueOf(3), list.get(2));
}
+ @Test
public void testImmutableSet() throws Exception
{
ImmutableSet set = MAPPER.readValue("[3,7,8]",
@@ -150,6 +158,7 @@ public void testImmutableSet() throws Exception
assertEquals(0, set.size());
}
+ @Test
public void testImmutableSetFromSingle() throws Exception
{
ObjectMapper mapper = builderWithModule()
@@ -161,6 +170,7 @@ public void testImmutableSetFromSingle() throws Exception
assertTrue(set.contains("abc"));
}
+ @Test
public void testImmutableSortedSet() throws Exception
{
ImmutableSortedSet set = MAPPER.readValue("[5,1,2]", new TypeReference>() { });
@@ -170,7 +180,8 @@ public void testImmutableSortedSet() throws Exception
assertEquals(Integer.valueOf(2), it.next());
assertEquals(Integer.valueOf(5), it.next());
}
-
+
+ @Test
public void testImmutableMap() throws Exception
{
final JavaType type = MAPPER.getTypeFactory().constructType(new TypeReference>() { });
@@ -188,6 +199,7 @@ public void testImmutableMap() throws Exception
assertEquals(1, map.size());
}
+ @Test
public void testImmutableSortedMap() throws Exception
{
ImmutableSortedMap map = MAPPER.readValue("{\"12\":true,\"4\":false}", new TypeReference>() { });
@@ -195,7 +207,8 @@ public void testImmutableSortedMap() throws Exception
assertEquals(Boolean.TRUE, map.get(Integer.valueOf(12)));
assertEquals(Boolean.FALSE, map.get(Integer.valueOf(4)));
}
-
+
+ @Test
public void testImmutableBiMap() throws Exception
{
ImmutableBiMap map = MAPPER.readValue("{\"12\":true,\"4\":false}", new TypeReference>() { });
@@ -212,6 +225,7 @@ public void testImmutableBiMap() throws Exception
/**********************************************************************
*/
+ @Test
public void testTypedImmutableset() throws Exception
{
ImmutableSet set;
@@ -244,6 +258,7 @@ public void testTypedImmutableset() throws Exception
assertEquals(0, ((ImmutableSet>) result.value).size());
}
+ @Test
public void testTypedImmutableMap() throws Exception
{
ImmutableMap map;
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/IterablesTest.java b/guava/src/test/java/tools/jackson/datatype/guava/IterablesTest.java
index 0c0af38b..256a960d 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/IterablesTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/IterablesTest.java
@@ -1,11 +1,15 @@
package tools.jackson.datatype.guava;
+import org.junit.jupiter.api.Test;
+
import com.fasterxml.jackson.annotation.JsonInclude;
import tools.jackson.databind.ObjectMapper;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
+import static org.junit.jupiter.api.Assertions.*;
+
public class IterablesTest extends ModuleTestBase
{
private final ObjectMapper MAPPER = mapperWithModule();
@@ -23,6 +27,7 @@ static class IterableWrapper {
/**********************************************************
*/
+ @Test
public void testIterablesSerialization() throws Exception
{
String json = MAPPER.writeValueAsString(Iterables.limit(Iterables.cycle(1,2,3), 3));
@@ -31,6 +36,7 @@ public void testIterablesSerialization() throws Exception
}
// for [#60]
+ @Test
public void testIterablesWithTransform() throws Exception
{
Iterable input = Iterables.transform(ImmutableList.of("mr", "bo", "jangles"),
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/JavaSerializableTest.java b/guava/src/test/java/tools/jackson/datatype/guava/JDKSerializableTest.java
similarity index 89%
rename from guava/src/test/java/tools/jackson/datatype/guava/JavaSerializableTest.java
rename to guava/src/test/java/tools/jackson/datatype/guava/JDKSerializableTest.java
index 1486af1c..d95d5f36 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/JavaSerializableTest.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/JDKSerializableTest.java
@@ -1,17 +1,20 @@
package tools.jackson.datatype.guava;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
+import java.io.*;
+
+import org.junit.jupiter.api.Test;
-import tools.jackson.core.type.TypeReference;
-import tools.jackson.databind.ObjectMapper;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableSet;
-public class JavaSerializableTest extends ModuleTestBase {
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.ObjectMapper;
+
+import static org.junit.jupiter.api.Assertions.*;
+public class JDKSerializableTest extends ModuleTestBase
+{
+ @Test
public void testSerializable() throws Exception {
ObjectMapper mapper = mapperWithModule();
@@ -23,6 +26,7 @@ public void testSerializable() throws Exception {
assertTrue(set.contains("abc"));
}
+ @Test
public void testSerializableConfigureAbsentsAsNull() throws Exception {
ObjectMapper mapper = mapperWithModule(true);
@@ -52,7 +56,7 @@ private ObjectMapper serializeAndDeserialize(ObjectMapper mapper) throws Excepti
Object deserializedObject = inputStream.readObject();
- //validate the object
+ // Actually `JsonMapper` but basic `ObjectMapper` works here
return (ObjectMapper) deserializedObject;
}
}
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/JsonDeserContentConverter92Test.java b/guava/src/test/java/tools/jackson/datatype/guava/JsonDeserContentConverter92Test.java
index e782500e..2c2875c5 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/JsonDeserContentConverter92Test.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/JsonDeserContentConverter92Test.java
@@ -4,12 +4,15 @@
import java.util.Arrays;
import java.util.List;
+import org.junit.jupiter.api.Test;
+
+import com.google.common.collect.*;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.annotation.JsonDeserialize;
import tools.jackson.databind.annotation.JsonSerialize;
import tools.jackson.databind.util.StdConverter;
-import com.google.common.collect.*;
+import static org.junit.jupiter.api.Assertions.*;
// [datatype-guava#92] : JsonDeserialize contentConverter does not work for non-builtin collections
public class JsonDeserContentConverter92Test extends ModuleTestBase {
@@ -88,6 +91,7 @@ static class GuavaImmutableBiMapHolder {
private final ObjectMapper MAPPER = mapperWithModule();
+ @Test
public void testJsonSerialize() throws Exception {
String jsonStr = a2q("{'list':[2,4]}");
@@ -95,6 +99,7 @@ public void testJsonSerialize() throws Exception {
assertEquals(jsonStr, _write(new GuavaListWrapper(ImmutableList.of(1, 2))));
}
+ @Test
public void testJsonDeserialize() throws Exception {
String withIntsArr = a2q("{'ints': [1,2,3] }");
String withIntsMap = a2q("{'ints': {'one':1, 'two':2, 'three':3}}");
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/ModuleTestBase.java b/guava/src/test/java/tools/jackson/datatype/guava/ModuleTestBase.java
index 338784d1..d0203d1d 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/ModuleTestBase.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/ModuleTestBase.java
@@ -2,14 +2,14 @@
import java.util.Arrays;
-import tools.jackson.databind.DatabindContext;
-import tools.jackson.databind.JavaType;
-import tools.jackson.databind.ObjectMapper;
+import tools.jackson.databind.*;
import tools.jackson.databind.cfg.MapperBuilder;
import tools.jackson.databind.json.JsonMapper;
import tools.jackson.databind.jsontype.PolymorphicTypeValidator;
-public abstract class ModuleTestBase extends junit.framework.TestCase
+import static org.junit.jupiter.api.Assertions.fail;
+
+public abstract class ModuleTestBase
{
public static class NoCheckSubTypeValidator
extends PolymorphicTypeValidator.Base
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/MultiMap104Test.java b/guava/src/test/java/tools/jackson/datatype/guava/MultiMap104Test.java
index 199ed94f..7f8ff8d7 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/MultiMap104Test.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/MultiMap104Test.java
@@ -1,10 +1,14 @@
package tools.jackson.datatype.guava;
+import org.junit.jupiter.api.Test;
+
+import com.google.common.collect.ArrayListMultimap;
+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import tools.jackson.databind.*;
-import com.google.common.collect.ArrayListMultimap;
+import static org.junit.jupiter.api.Assertions.*;
public class MultiMap104Test extends ModuleTestBase
{
@@ -20,12 +24,14 @@ static class Outside104 {
// [datatypes-collections#104]
+ @Test
public void testPolymorphicArrayMapEmpty() throws Exception {
final ArrayListMultimap multimap = ArrayListMultimap.create();
multimap.put("aKey", 1);
_testPolymorphicArrayMap(multimap);
}
+ @Test
public void testPolymorphicArrayMapNonEmpty() throws Exception {
_testPolymorphicArrayMap(ArrayListMultimap.create());
}
diff --git a/guava/src/test/java/tools/jackson/datatype/guava/MultiMapOrderMpEntriesByKeys7Test.java b/guava/src/test/java/tools/jackson/datatype/guava/MultiMapOrderEntriesByKeys7Test.java
similarity index 96%
rename from guava/src/test/java/tools/jackson/datatype/guava/MultiMapOrderMpEntriesByKeys7Test.java
rename to guava/src/test/java/tools/jackson/datatype/guava/MultiMapOrderEntriesByKeys7Test.java
index bdb21cd4..8715091f 100644
--- a/guava/src/test/java/tools/jackson/datatype/guava/MultiMapOrderMpEntriesByKeys7Test.java
+++ b/guava/src/test/java/tools/jackson/datatype/guava/MultiMapOrderEntriesByKeys7Test.java
@@ -3,16 +3,17 @@
import java.util.ArrayList;
import java.util.List;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
-import tools.jackson.databind.*;
+import org.junit.jupiter.api.Test;
import com.google.common.collect.*;
-import static org.junit.Assert.assertNotEquals;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+import tools.jackson.databind.*;
+import static org.junit.jupiter.api.Assertions.*;
// [jackson-datatype-collections#7]: [Guava] Add support for WRITE_SORTED_MAP_ENTRIES
-public class MultiMapOrderMpEntriesByKeys7Test extends ModuleTestBase
+public class MultiMapOrderEntriesByKeys7Test extends ModuleTestBase
{
/*
/**********************************************************
@@ -51,6 +52,7 @@ public String toString() {
private final ObjectMapper MAPPER = mapperWithModule();
+ @Test
public void testMultimapSerializeOrderedByKey() throws Exception {
final Multimap