Fix test for null-safe KotlinJsonAdapterFactory adapters.

This commit is contained in:
Eric Cochran 2018-11-17 02:23:28 -08:00 committed by GitHub
parent 5f5631e34f
commit 38b08f81e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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")