mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Fix test for null-safe KotlinJsonAdapterFactory adapters.
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user