Fix test for null-safe KotlinJsonAdapterFactory adapters.
This commit is contained in:
parent
5f5631e34f
commit
38b08f81e6
1 changed files with 3 additions and 1 deletions
|
@ -943,7 +943,9 @@ class KotlinJsonAdapterTest {
|
|||
}
|
||||
|
||||
@Test fun adaptersAreNullSafe() {
|
||||
val moshi = Moshi.Builder().build()
|
||||
val moshi = Moshi.Builder()
|
||||
.add(KotlinJsonAdapterFactory())
|
||||
.build()
|
||||
val adapter = moshi.adapter(HasNonNullConstructorParameter::class.java)
|
||||
assertThat(adapter.fromJson("null")).isNull()
|
||||
assertThat(adapter.toJson(null)).isEqualTo("null")
|
||||
|
|
Loading…
Reference in a new issue