Skip to content

Commit ae02cb9

Browse files
committed
More fixing of tests
1 parent 0604fab commit ae02cb9

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

src/test/java/com/fasterxml/jackson/databind/deser/merge/ArrayMergeTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public void testByteArrayMerging() throws Exception
129129
MergedX<byte[]> input = new MergedX<byte[]>(new byte[] { 1, 2 });
130130
MergedX<byte[]> result = MAPPER
131131
.readerFor(new TypeReference<MergedX<byte[]>>() {})
132+
.without(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
132133
.withValueToUpdate(input)
133134
.readValue(a2q("{'value':[4, 6.0, null]}"));
134135
assertSame(input, result);

src/test/java/com/fasterxml/jackson/databind/introspect/DefaultCreatorDetection4584Test.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public void testCanonicalConstructor2ArgPropertiesCreator() throws Exception
189189
assertEquals(POJO4584.factoryString(null),
190190
readerWith(new PrimaryCreatorFindingIntrospector(JsonCreator.Mode.PROPERTIES,
191191
String.class, Integer.TYPE))
192+
.without(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
192193
.readValue(a2q("{}")));
193194
}
194195

src/test/java/com/fasterxml/jackson/databind/introspect/IsGetterRenaming2527Test.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public PropertyName findRenameByField(MapperConfig<?> config,
7272

7373
private final ObjectMapper MAPPER = jsonMapperBuilder()
7474
.annotationIntrospector(new MyIntrospector())
75+
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
7576
.build();
7677

7778
@Test

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.junit.jupiter.api.Test;
44

55
import com.fasterxml.jackson.annotation.*;
6-
6+
import com.fasterxml.jackson.databind.DeserializationFeature;
77
import com.fasterxml.jackson.databind.MapperFeature;
88
import com.fasterxml.jackson.databind.ObjectMapper;
99
import com.fasterxml.jackson.databind.testutil.DatabindTestUtil;
@@ -120,6 +120,7 @@ public void testWithViewAndCreator() throws Exception
120120
{
121121
AsArrayWithViewAndCreator result = MAPPER.readerFor(AsArrayWithViewAndCreator.class)
122122
.withView(ViewB.class)
123+
.without(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
123124
.readValue("[1,2,3]");
124125
// should include 'c' (not view-able) and 'b' (include in ViewB) but not 'a'
125126
assertEquals(3, result.c);

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,26 @@ public void testBuilderWithUpdate() throws Exception
146146
@Test
147147
public void testWithCreator() throws Exception
148148
{
149-
CreatorValue value = MAPPER.readValue("[1,2,3]", CreatorValue.class);
149+
ObjectReader r = MAPPER.readerFor(CreatorValue.class)
150+
.without(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
151+
152+
CreatorValue value = r.readValue("[1,2,3]");
150153
assertEquals(1, value.a);
151154
assertEquals(2, value.b);
152155
assertEquals(3, value.c);
153156

154157
// and should be ok with partial too?
155-
value = MAPPER.readValue("[1,2]", CreatorValue.class);
158+
value = r.readValue("[1,2]");
156159
assertEquals(1, value.a);
157160
assertEquals(2, value.b);
158161
assertEquals(0, value.c);
159162

160-
value = MAPPER.readValue("[1]", CreatorValue.class);
163+
value = r.readValue("[1]");
161164
assertEquals(1, value.a);
162165
assertEquals(0, value.b);
163166
assertEquals(0, value.c);
164167

165-
value = MAPPER.readValue("[]", CreatorValue.class);
168+
value = r.readValue("[]");
166169
assertEquals(0, value.a);
167170
assertEquals(0, value.b);
168171
assertEquals(0, value.c);

0 commit comments

Comments
 (0)