mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Merge pull request #750 from square/eric.tests
Fix KotlinJsonAdapter tests that were missing the factory.
This commit is contained in:
@@ -869,6 +869,7 @@ class KotlinJsonAdapterTest {
|
|||||||
return value ?: "fallback"
|
return value ?: "fallback"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.add(KotlinJsonAdapterFactory())
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
assertThat(moshi.adapter(HasNonNullConstructorParameter::class.java)
|
assertThat(moshi.adapter(HasNonNullConstructorParameter::class.java)
|
||||||
@@ -935,6 +936,7 @@ class KotlinJsonAdapterTest {
|
|||||||
}
|
}
|
||||||
null
|
null
|
||||||
})
|
})
|
||||||
|
.add(KotlinJsonAdapterFactory())
|
||||||
.build()
|
.build()
|
||||||
val adapter = moshi.adapter(HasNullableBoolean::class.java).serializeNulls()
|
val adapter = moshi.adapter(HasNullableBoolean::class.java).serializeNulls()
|
||||||
assertThat(adapter.fromJson("""{"boolean":"not a boolean"}"""))
|
assertThat(adapter.fromJson("""{"boolean":"not a boolean"}"""))
|
||||||
|
Reference in New Issue
Block a user