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:
Artem Daugel-Dauge 2018-11-24 06:24:19 +03:00 committed by Jesse Wilson
parent 2265f5e9b8
commit 9aaef1f6f8
3 changed files with 9 additions and 2 deletions

View file

@ -113,6 +113,11 @@
</configuration>
</execution>
</executions>
<configuration>
<args>
<arg>-Werror</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View file

@ -35,6 +35,7 @@ import org.junit.Test
import java.util.Locale
import kotlin.reflect.full.memberProperties
@Suppress("UNUSED", "UNUSED_PARAMETER")
class GeneratedAdaptersTest {
private val moshi = Moshi.Builder().build()
@ -1037,7 +1038,7 @@ class GeneratedAdaptersTest {
@Test fun nullablePrimitivesUseBoxedPrimitiveAdapters() {
val moshi = Moshi.Builder()
.add(JsonAdapter.Factory { type, annotations, moshi ->
.add(JsonAdapter.Factory { type, _, _ ->
if (Boolean::class.javaObjectType == type) {
return@Factory object:JsonAdapter<Boolean?>() {
override fun fromJson(reader: JsonReader): Boolean? {

View file

@ -34,6 +34,7 @@ import java.util.Locale
import java.util.SimpleTimeZone
import kotlin.annotation.AnnotationRetention.RUNTIME
@Suppress("UNUSED", "UNUSED_PARAMETER")
class KotlinJsonAdapterTest {
@Test fun constructorParameters() {
val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
@ -918,7 +919,7 @@ class KotlinJsonAdapterTest {
@Test fun nullablePrimitivesUseBoxedPrimitiveAdapters() {
val moshi = Moshi.Builder()
.add(JsonAdapter.Factory { type, annotations, moshi ->
.add(JsonAdapter.Factory { type, _, _ ->
if (Boolean::class.javaObjectType == type) {
return@Factory object: JsonAdapter<Boolean?>() {
override fun fromJson(reader: JsonReader): Boolean? {