Skip to content

Commit a1d685f

Browse files
committed
Update & move GitHub 335 to non-failing tests
1 parent c8503dd commit a1d685f

File tree

1 file changed

+7
-11
lines changed
  • src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github

1 file changed

+7
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.fasterxml.jackson.module.kotlin.test.github.failing
1+
package com.fasterxml.jackson.module.kotlin.test.github
22

33
import com.fasterxml.jackson.annotation.JsonSubTypes
44
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
@@ -7,9 +7,8 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo.As
77
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id
88
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
99
import com.fasterxml.jackson.module.kotlin.readValue
10-
import com.fasterxml.jackson.module.kotlin.test.expectFailure
1110
import org.junit.Test
12-
import kotlin.test.assertNull
11+
import kotlin.test.assertEquals
1312

1413
class Github335Test {
1514
val mapper = jacksonObjectMapper()
@@ -18,10 +17,10 @@ class Github335Test {
1817
data class UniquePayload(val data: String) : Payload
1918

2019
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?
2524
)
2625

2726
@Test
@@ -30,9 +29,6 @@ class Github335Test {
3029
val json = mapper.writeValueAsString(oldEntity)
3130
val newEntity = mapper.readValue<MyEntity>(json)
3231

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)
3733
}
3834
}

0 commit comments

Comments
 (0)