Skip to content

Commit 63269d3

Browse files
committed
Fix failing test to fail appropriately
1 parent 8576b17 commit 63269d3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/test/java/tools/jackson/failing/SetterlessList2692Test.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
import com.fasterxml.jackson.annotation.JsonCreator;
99
import com.fasterxml.jackson.annotation.JsonProperty;
1010

11+
import tools.jackson.databind.MapperFeature;
1112
import tools.jackson.databind.ObjectMapper;
1213
import tools.jackson.databind.testutil.DatabindTestUtil;
1314

15+
import static org.junit.jupiter.api.Assertions.assertNotNull;
16+
17+
// 04-Sep-2024, tatu: No longer fails for 3.0? Due to default settings
18+
// change?
1419
class SetterlessList2692Test extends DatabindTestUtil {
1520
static class DataBean {
1621

@@ -38,11 +43,11 @@ public String toString() {
3843

3944
@Test
4045
void issue2692() throws Exception {
41-
ObjectMapper om = newJsonMapper();
42-
String json;
43-
DataBean out;
44-
json = "{\"list\":[\"11\"],\"val\":\"VAL2\"}";
45-
out = om.readerFor(DataBean.class).readValue(json);
46-
System.out.println("this is ko" + out);
46+
ObjectMapper om = jsonMapperBuilder()
47+
.enable(MapperFeature.USE_GETTERS_AS_SETTERS)
48+
.build();
49+
String json = "{\"list\":[\"11\"],\"val\":\"VAL2\"}";
50+
DataBean out = om.readerFor(DataBean.class).readValue(json);
51+
assertNotNull(out);
4752
}
4853
}

0 commit comments

Comments
 (0)