Skip to content

Commit 7cbc141

Browse files
committed
More test config fixes
1 parent 216cdd3 commit 7cbc141

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/test/java/com/fasterxml/jackson/databind/struct/TestPOJOAsArrayAdvanced.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import com.fasterxml.jackson.annotation.*;
66

7+
import com.fasterxml.jackson.databind.MapperFeature;
78
import com.fasterxml.jackson.databind.ObjectMapper;
89
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
910

@@ -88,7 +89,11 @@ public AsArrayWithViewAndCreator(@JsonProperty("a") int a,
8889
/*****************************************************
8990
*/
9091

91-
private final static ObjectMapper MAPPER = newJsonMapper();
92+
// 06-Jan-2025, tatu: NOTE! need to make sure Default View Inclusion
93+
// is enabled for tests to work as expected
94+
private final static ObjectMapper MAPPER = jsonMapperBuilder()
95+
.enable(MapperFeature.DEFAULT_VIEW_INCLUSION)
96+
.build();
9297

9398
@Test
9499
public void testWithView() throws Exception

src/test/java/com/fasterxml/jackson/databind/struct/TestPOJOAsArrayWithBuilder.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.fasterxml.jackson.annotation.*;
66

77
import com.fasterxml.jackson.databind.DeserializationFeature;
8+
import com.fasterxml.jackson.databind.MapperFeature;
89
import com.fasterxml.jackson.databind.ObjectMapper;
910
import com.fasterxml.jackson.databind.ObjectReader;
1011
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -170,7 +171,13 @@ public void testWithCreator() throws Exception
170171
@Test
171172
public void testWithCreatorAndView() throws Exception
172173
{
173-
ObjectReader reader = MAPPER.readerFor(CreatorValue.class);
174+
// 06-Jan-2025, tatu: NOTE! need to make sure Default View Inclusion
175+
// is enabled for tests to work as expected
176+
ObjectReader reader = jsonMapperBuilder()
177+
.enable(MapperFeature.DEFAULT_VIEW_INCLUSION)
178+
.build()
179+
.readerFor(CreatorValue.class);
180+
174181
CreatorValue value;
175182

176183
// First including values in view

0 commit comments

Comments
 (0)