File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/kotlin/com/fasterxml/jackson/module/kotlin/test/github Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.fasterxml.jackson.module.kotlin.test.github
2+
3+ import com.fasterxml.jackson.databind.exc.InvalidNullException
4+ import com.fasterxml.jackson.module.kotlin.KotlinFeature
5+ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
6+ import org.junit.jupiter.api.assertThrows
7+ import kotlin.test.Test
8+
9+ class GitHub976 {
10+ data class PrimitiveList (val list : List <Int >)
11+
12+ @Test
13+ fun strictNullChecks () {
14+ val om = jacksonObjectMapper {
15+ enable(KotlinFeature .StrictNullChecks )
16+ }
17+ assertThrows<InvalidNullException > {
18+ om.readValue(""" {"list": [""] }""" .toByteArray(), PrimitiveList ::class .java)
19+ }
20+ }
21+
22+ @Test
23+ fun newStrictNullChecksRegression () {
24+ val om = jacksonObjectMapper {
25+ enable(KotlinFeature .NewStrictNullChecks )
26+ }
27+ assertThrows<InvalidNullException > {
28+ om.readValue(""" {"list": [""] }""" .toByteArray(), PrimitiveList ::class .java)
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments