Skip to content

Commit

Permalink
Tiny improvement to #3690 test (wrt #3924)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 2, 2023
1 parent e74336c commit 17eb07a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

public class DisableCoercions3690Test extends BaseMapTest
{
// [databind#3690]
static class Input3690 {
public List<String> field;
}

// [databind#3690]
public void testFailMessage3690() throws Exception
public void testCoercionFail3690() throws Exception
{
ObjectMapper mapper = jsonMapperBuilder()
.withCoercionConfigDefaults(config -> {
Expand All @@ -31,6 +32,8 @@ public void testFailMessage3690() throws Exception
mapper.readValue(json, Input3690.class);
fail("Should not pass");
} catch (InvalidFormatException e) {
assertEquals(String.class, e.getTargetType());
assertEquals(Integer.valueOf(1), e.getValue());
verifyException(e, "Cannot coerce Integer value (1)");
verifyException(e, "to `java.lang.String` value");
}
Expand Down

0 comments on commit 17eb07a

Please sign in to comment.