Skip to content

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/kotlin/com/fasterxml/jackson/module/kotlin/JDKSerializabilityTestHelper.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.fasterxml.jackson.module.kotlin
22

3-
import junit.framework.TestCase
3+
import org.junit.jupiter.api.Assertions.fail
44
import java.io.ByteArrayInputStream
55
import java.io.ByteArrayOutputStream
66
import java.io.ObjectInputStream
@@ -14,14 +14,13 @@ fun jdkSerialize(o: Any): ByteArray {
1414
return bytes.toByteArray()
1515
}
1616

17-
fun <T> jdkDeserialize(raw: ByteArray): T? {
17+
fun <T> jdkDeserialize(raw: ByteArray): T {
1818
val objIn = ObjectInputStream(ByteArrayInputStream(raw))
1919
return try {
2020
@Suppress("UNCHECKED_CAST")
2121
objIn.readObject() as T
2222
} catch (e: ClassNotFoundException) {
23-
TestCase.fail("Missing class: " + e.message)
24-
null
23+
fail("Missing class: " + e.message)
2524
} finally {
2625
objIn.close()
2726
}

0 commit comments

Comments
 (0)