File tree 1 file changed +4
-3
lines changed
src/test/java/com/fasterxml/jackson/datatype/joda/deser
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 9
9
import com .fasterxml .jackson .core .type .TypeReference ;
10
10
import com .fasterxml .jackson .databind .JsonMappingException ;
11
11
import com .fasterxml .jackson .databind .ObjectMapper ;
12
+ import com .fasterxml .jackson .databind .exc .MismatchedInputException ;
12
13
import com .fasterxml .jackson .datatype .joda .JodaTestBase ;
13
14
14
15
public class DurationDeserializationTest extends JodaTestBase
@@ -48,9 +49,9 @@ public void testDurationFailsDeserializingUnexpectedType() throws IOException
48
49
try {
49
50
MAPPER .readValue ("{\" foo\" :1234}" , Duration .class );
50
51
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" );
54
55
}
55
56
}
56
57
You can’t perform that action at this time.
0 commit comments