File tree 2 files changed +32
-1
lines changed
src/test/kotlin/com/fasterxml/jackson/module/kotlin
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fun serializeAndDeserializeTypeable() {
33
33
val newEntity = mapper.readValue<MyEntity >(json)
34
34
35
35
expectFailure<AssertionError >(" GitHub #335 has been fixed!" ) {
36
- // newEntity.type is hte string "null" instead of the null value
36
+ // newEntity.type is the string "null" instead of the null value
37
37
assertNull(newEntity.type)
38
38
}
39
39
}
Original file line number Diff line number Diff line change
1
+ package com.fasterxml.jackson.module.kotlin.test.github.failing
2
+
3
+ import com.fasterxml.jackson.annotation.JsonProperty
4
+ import com.fasterxml.jackson.databind.JsonMappingException
5
+ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
6
+ import com.fasterxml.jackson.module.kotlin.readValue
7
+ import com.fasterxml.jackson.module.kotlin.test.expectFailure
8
+ import org.junit.Test
9
+
10
+ class TestGithub611 {
11
+
12
+ class TestClass (@JsonProperty(" id" ) var id : UShort ) {
13
+ // Empty constructor
14
+ constructor () : this (1u )
15
+ }
16
+
17
+ // Value fits into UShort, but not (Java) Short
18
+ private val jsonData = """
19
+ {
20
+ "id": 50000
21
+ }
22
+ """
23
+
24
+ @Test
25
+ fun testJsonParsing () {
26
+ val mapper = jacksonObjectMapper()
27
+ expectFailure<JsonMappingException >(" GitHub #611 has been fixed!" ) {
28
+ val dataClassInstance = mapper.readValue<TestClass >(jsonData)
29
+ }
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments