1
- package com.fasterxml.jackson.module.kotlin.test.github.failing
1
+ package com.fasterxml.jackson.module.kotlin.test.github
2
2
3
3
import com.fasterxml.jackson.annotation.JsonSubTypes
4
4
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
@@ -7,9 +7,8 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo.As
7
7
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id
8
8
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
9
9
import com.fasterxml.jackson.module.kotlin.readValue
10
- import com.fasterxml.jackson.module.kotlin.test.expectFailure
11
10
import org.junit.Test
12
- import kotlin.test.assertNull
11
+ import kotlin.test.assertEquals
13
12
14
13
class Github335Test {
15
14
val mapper = jacksonObjectMapper()
@@ -18,10 +17,10 @@ class Github335Test {
18
17
data class UniquePayload (val data : String ) : Payload
19
18
20
19
data class MyEntity (
21
- val type : String? ,
22
- @JsonTypeInfo(use = Id .NAME , include = As .EXTERNAL_PROPERTY , property = " type" )
23
- @JsonSubTypes(Type (value = UniquePayload ::class , name = " UniquePayload" ))
24
- val payload : Payload ?
20
+ val type : String? ,
21
+ @JsonTypeInfo(use = Id .NAME , include = As .EXTERNAL_PROPERTY , property = " type" )
22
+ @JsonSubTypes(Type (value = UniquePayload ::class , name = " UniquePayload" ))
23
+ val payload : Payload ?
25
24
)
26
25
27
26
@Test
@@ -30,9 +29,6 @@ class Github335Test {
30
29
val json = mapper.writeValueAsString(oldEntity)
31
30
val newEntity = mapper.readValue<MyEntity >(json)
32
31
33
- expectFailure<AssertionError >(" GitHub #335 has been fixed!" ) {
34
- // newEntity.type is the string "null" instead of the null value
35
- assertNull(newEntity.type)
36
- }
32
+ assertEquals(oldEntity, newEntity)
37
33
}
38
34
}
0 commit comments