Skip to content

Commit

Permalink
Fix a test wrt FasterXML/jackson-databind#4275 (DeserializationFeatur…
Browse files Browse the repository at this point in the history
…e.FAIL_ON_UNEXPECTED_VIEW_PROPERTIES enabled by default in 3.0)
  • Loading branch information
cowtowncoder committed Jan 13, 2024
1 parent 0801ba2 commit 943f663
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import tools.jackson.dataformat.csv.CsvReadException;
import tools.jackson.dataformat.csv.CsvSchema;
import tools.jackson.dataformat.csv.ModuleTestBase;
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.ser.std.SimpleFilterProvider;

public class JsonViewFilteringTest extends ModuleTestBase
Expand Down Expand Up @@ -75,7 +76,11 @@ public void testWithJsonView() throws Exception

// plus read back?
final String INPUT = "a,aa,b\n5,6,7\n";
Bean result = MAPPER.readerFor(Bean.class).with(schema).withView(ViewB.class).readValue(INPUT);
Bean result = MAPPER
.readerFor(Bean.class)
.with(schema)
.without(DeserializationFeature.FAIL_ON_UNEXPECTED_VIEW_PROPERTIES)
.withView(ViewB.class).readValue(INPUT);
assertEquals("5", result.a);
// due to filtering, ought to use default
assertEquals("2", result.aa);
Expand Down

0 comments on commit 943f663

Please sign in to comment.