Skip to content

Commit 21915d2

Browse files
committed
...
1 parent bc1c7ce commit 21915d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/test/java/com/fasterxml/jackson/datatype/joda/deser/DurationDeserializationTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.fasterxml.jackson.core.type.TypeReference;
1010
import com.fasterxml.jackson.databind.JsonMappingException;
1111
import com.fasterxml.jackson.databind.ObjectMapper;
12+
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
1213
import com.fasterxml.jackson.datatype.joda.JodaTestBase;
1314

1415
public class DurationDeserializationTest extends JodaTestBase
@@ -48,9 +49,9 @@ public void testDurationFailsDeserializingUnexpectedType() throws IOException
4849
try {
4950
MAPPER.readValue("{\"foo\":1234}", Duration.class);
5051
fail();
51-
} catch (JsonMappingException e) {
52-
// there's location info involving a string object id on the second line, so just use the first line
53-
assertEquals("expected JSON Number or String", e.getMessage().split("\n")[0]);
52+
} catch (MismatchedInputException e) {
53+
verifyException(e, "Cannot deserialize value of type `org.joda.time.Duration`");
54+
verifyException(e, "expected Number or String");
5455
}
5556
}
5657

0 commit comments

Comments
 (0)