mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
Treat warnings as errors in moshi-kotlin tests (#730)
* Fix/supress warnings in tests * Treat kotlinc warnings as errors in tests
This commit is contained in:
committed by
Jesse Wilson
parent
2265f5e9b8
commit
9aaef1f6f8
@@ -113,6 +113,11 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<args>
|
||||||
|
<arg>-Werror</arg>
|
||||||
|
</args>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
@@ -35,6 +35,7 @@ import org.junit.Test
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import kotlin.reflect.full.memberProperties
|
import kotlin.reflect.full.memberProperties
|
||||||
|
|
||||||
|
@Suppress("UNUSED", "UNUSED_PARAMETER")
|
||||||
class GeneratedAdaptersTest {
|
class GeneratedAdaptersTest {
|
||||||
|
|
||||||
private val moshi = Moshi.Builder().build()
|
private val moshi = Moshi.Builder().build()
|
||||||
@@ -1037,7 +1038,7 @@ class GeneratedAdaptersTest {
|
|||||||
|
|
||||||
@Test fun nullablePrimitivesUseBoxedPrimitiveAdapters() {
|
@Test fun nullablePrimitivesUseBoxedPrimitiveAdapters() {
|
||||||
val moshi = Moshi.Builder()
|
val moshi = Moshi.Builder()
|
||||||
.add(JsonAdapter.Factory { type, annotations, moshi ->
|
.add(JsonAdapter.Factory { type, _, _ ->
|
||||||
if (Boolean::class.javaObjectType == type) {
|
if (Boolean::class.javaObjectType == type) {
|
||||||
return@Factory object:JsonAdapter<Boolean?>() {
|
return@Factory object:JsonAdapter<Boolean?>() {
|
||||||
override fun fromJson(reader: JsonReader): Boolean? {
|
override fun fromJson(reader: JsonReader): Boolean? {
|
||||||
|
@@ -34,6 +34,7 @@ import java.util.Locale
|
|||||||
import java.util.SimpleTimeZone
|
import java.util.SimpleTimeZone
|
||||||
import kotlin.annotation.AnnotationRetention.RUNTIME
|
import kotlin.annotation.AnnotationRetention.RUNTIME
|
||||||
|
|
||||||
|
@Suppress("UNUSED", "UNUSED_PARAMETER")
|
||||||
class KotlinJsonAdapterTest {
|
class KotlinJsonAdapterTest {
|
||||||
@Test fun constructorParameters() {
|
@Test fun constructorParameters() {
|
||||||
val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
|
val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
|
||||||
@@ -918,7 +919,7 @@ class KotlinJsonAdapterTest {
|
|||||||
|
|
||||||
@Test fun nullablePrimitivesUseBoxedPrimitiveAdapters() {
|
@Test fun nullablePrimitivesUseBoxedPrimitiveAdapters() {
|
||||||
val moshi = Moshi.Builder()
|
val moshi = Moshi.Builder()
|
||||||
.add(JsonAdapter.Factory { type, annotations, moshi ->
|
.add(JsonAdapter.Factory { type, _, _ ->
|
||||||
if (Boolean::class.javaObjectType == type) {
|
if (Boolean::class.javaObjectType == type) {
|
||||||
return@Factory object: JsonAdapter<Boolean?>() {
|
return@Factory object: JsonAdapter<Boolean?>() {
|
||||||
override fun fromJson(reader: JsonReader): Boolean? {
|
override fun fromJson(reader: JsonReader): Boolean? {
|
||||||
|
Reference in New Issue
Block a user