Skip to content

Commit

Permalink
Fix failing test to fail appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 5, 2024
1 parent 8576b17 commit 63269d3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/test/java/tools/jackson/failing/SetterlessList2692Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import tools.jackson.databind.MapperFeature;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.testutil.DatabindTestUtil;

import static org.junit.jupiter.api.Assertions.assertNotNull;

// 04-Sep-2024, tatu: No longer fails for 3.0? Due to default settings
// change?
class SetterlessList2692Test extends DatabindTestUtil {
static class DataBean {

Expand Down Expand Up @@ -38,11 +43,11 @@ public String toString() {

@Test
void issue2692() throws Exception {
ObjectMapper om = newJsonMapper();
String json;
DataBean out;
json = "{\"list\":[\"11\"],\"val\":\"VAL2\"}";
out = om.readerFor(DataBean.class).readValue(json);
System.out.println("this is ko" + out);
ObjectMapper om = jsonMapperBuilder()
.enable(MapperFeature.USE_GETTERS_AS_SETTERS)
.build();
String json = "{\"list\":[\"11\"],\"val\":\"VAL2\"}";
DataBean out = om.readerFor(DataBean.class).readValue(json);
assertNotNull(out);
}
}

0 comments on commit 63269d3

Please sign in to comment.