Skip to content

Commit 5c9f0e0

Browse files
committed
Minor test cleanup
1 parent 734973b commit 5c9f0e0

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.fasterxml.jackson.databind.JavaType;
66
import com.fasterxml.jackson.databind.ObjectMapper;
77
import com.fasterxml.jackson.databind.cfg.MapperConfig;
8+
import com.fasterxml.jackson.databind.json.JsonMapper;
89
import com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator;
910

1011
public abstract class ModuleTestBase extends junit.framework.TestCase
@@ -27,9 +28,12 @@ public Validity validateBaseType(MapperConfig<?> config, JavaType baseType) {
2728
*/
2829

2930
static ObjectMapper mapperWithModule() {
30-
ObjectMapper mapper = new ObjectMapper();
31-
mapper.registerModule(new Jdk8Module());
32-
return mapper;
31+
return mapperBuilderWithModule().build();
32+
}
33+
34+
static JsonMapper.Builder mapperBuilderWithModule() {
35+
return JsonMapper.builder()
36+
.addModule(new Jdk8Module());
3337
}
3438

3539
@SuppressWarnings("deprecation")

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ static class OptionalDoubleBean {
4242
}
4343

4444
private ObjectMapper MAPPER = mapperWithModule();
45-
private ObjectMapper MAPPER_WITHOUT_COERCION = MAPPER.copy().disable(MapperFeature.ALLOW_COERCION_OF_SCALARS);
45+
private ObjectMapper MAPPER_WITHOUT_COERCION = mapperBuilderWithModule()
46+
.disable(MapperFeature.ALLOW_COERCION_OF_SCALARS)
47+
.build();
4648

4749
/*
4850
/**********************************************************

datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/JavaTimeFeature.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public enum JavaTimeFeature implements JacksonFeature
1717
* Default setting is enabled, for backwards-compatibility with
1818
* Jackson 2.15.
1919
*/
20-
NORMALIZE_DESERIALIZED_ZONE_ID(true);
20+
NORMALIZE_DESERIALIZED_ZONE_ID(true)
21+
;
2122

2223
/**
2324
* Whether feature is enabled or disabled by default.

0 commit comments

Comments
 (0)