Skip to content

Commit 05893c5

Browse files
committed
remove use of deprecated method from test
1 parent cd3e57a commit 05893c5

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

datatypes/src/test/java/com/fasterxml/jackson/datatype/jdk8/OptionalTest.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@
1111
import com.fasterxml.jackson.core.JsonProcessingException;
1212
import com.fasterxml.jackson.core.type.TypeReference;
1313

14-
import com.fasterxml.jackson.databind.DeserializationContext;
15-
import com.fasterxml.jackson.databind.JavaType;
16-
import com.fasterxml.jackson.databind.ObjectMapper;
17-
import com.fasterxml.jackson.databind.SerializerProvider;
14+
import com.fasterxml.jackson.databind.*;
1815
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
1916
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
2017
import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;
2118
import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer;
22-
import com.fasterxml.jackson.databind.type.TypeBindings;
2319
import com.fasterxml.jackson.databind.type.TypeFactory;
2420

2521
public class OptionalTest extends ModuleTestBase
@@ -256,17 +252,15 @@ public void testOtherRefSerializers() throws Exception
256252
public void testTypeResolution() throws Exception
257253
{
258254
// Should be able to construct using parametric `constructType()`
255+
// 19-Oct-2020, tatu: should not try to use TypeBindings, use different
256+
// method
259257
final TypeFactory tf = MAPPER.getTypeFactory();
260-
JavaType t = tf.constructType(Optional.class, TypeBindings.create(Optional.class, new JavaType[] {
261-
tf.constructType(Set.class, TypeBindings.create(Set.class, new JavaType[] {
262-
tf.constructType(Integer.class)
263-
}))
264-
}));
258+
JavaType t = tf.constructType(Optional.class);
265259
assertEquals(Optional.class, t.getRawClass());
266260
assertTrue(t.isReferenceType());
261+
// without parameterization, defaults to `java.lang.Object`
267262
JavaType t2 = t.getReferencedType();
268-
assertEquals(Set.class, t2.getRawClass());
269-
assertTrue(t2.isCollectionLikeType());
263+
assertEquals(Object.class, t2.getRawClass());
270264

271265
// as well as:
272266
t = tf.constructParametricType(Optional.class,

0 commit comments

Comments
 (0)