Skip to content

Commit 5e0c983

Browse files
committed
Move test from #31 under failing, since it won't pass until changes are made (either here or in databind)
1 parent 85990b9 commit 5e0c983

File tree

2 files changed

+40
-29
lines changed

2 files changed

+40
-29
lines changed

parameter-names/src/test/java/com/fasterxml/jackson/module/paramnames/JsonCreatorTest.java

-29
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import com.fasterxml.jackson.databind.*;
55
import org.junit.*;
66

7-
import java.io.IOException;
8-
97
import static org.assertj.core.api.BDDAssertions.*;
108

119
public class JsonCreatorTest
@@ -24,21 +22,6 @@ public void shouldDeserializeClassWithJsonCreatorOnStaticMethod() throws Excepti
2422
then(actual).isEqualToComparingFieldByField(new ClassWithJsonCreatorOnStaticMethod("1st", "2nd"));
2523
}
2624

27-
@Test
28-
public void shouldDeserializeUsingDefaultPropertyCreatorSetting() throws IOException {
29-
// given
30-
ObjectMapper objectMapper = new ObjectMapper();
31-
objectMapper.registerModule(new ParameterNamesModule());
32-
objectMapper.enable(MapperFeature.CREATOR_MODE_DEFAULT_PROPERTIES);
33-
int givenValue = 1;
34-
35-
// when
36-
SinglePropertyValueClass actual = objectMapper.readValue("{\"value\":\"" + givenValue + "\"}",
37-
SinglePropertyValueClass.class);
38-
// then
39-
then(actual).isEqualToComparingFieldByField(new SinglePropertyValueClass(givenValue));
40-
}
41-
4225
static class ClassWithJsonCreatorOnStaticMethod {
4326
final String first;
4427
final String second;
@@ -54,16 +37,4 @@ static ClassWithJsonCreatorOnStaticMethod factory(String first, String second) {
5437
return new ClassWithJsonCreatorOnStaticMethod(first, second);
5538
}
5639
}
57-
58-
static class SinglePropertyValueClass {
59-
private final Integer value;
60-
61-
SinglePropertyValueClass(Integer value) {
62-
this.value = value;
63-
}
64-
65-
public Integer getValue() {
66-
return value;
67-
}
68-
}
6940
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.fasterxml.jackson.module.paramnames.failing;
2+
3+
import com.fasterxml.jackson.databind.*;
4+
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
5+
6+
import org.junit.*;
7+
8+
import java.io.IOException;
9+
10+
import static org.assertj.core.api.BDDAssertions.*;
11+
12+
public class JsonCreatorTest
13+
{
14+
@Test
15+
public void shouldDeserializeUsingDefaultPropertyCreatorSetting() throws IOException {
16+
// given
17+
ObjectMapper objectMapper = new ObjectMapper();
18+
objectMapper.registerModule(new ParameterNamesModule());
19+
objectMapper.enable(MapperFeature.CREATOR_MODE_DEFAULT_PROPERTIES);
20+
int givenValue = 1;
21+
22+
// when
23+
SinglePropertyValueClass actual = objectMapper.readValue("{\"value\":\"" + givenValue + "\"}",
24+
SinglePropertyValueClass.class);
25+
// then
26+
then(actual).isEqualToComparingFieldByField(new SinglePropertyValueClass(givenValue));
27+
}
28+
29+
static class SinglePropertyValueClass {
30+
private final Integer value;
31+
32+
SinglePropertyValueClass(Integer value) {
33+
this.value = value;
34+
}
35+
36+
public Integer getValue() {
37+
return value;
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)