Repository: ImFlog/schema-registry-plugin
Pull request #38 (2020-03-28 21:59:25)

Add lazy property configuration, change task creation using register


Patch:
diff --git a/build.gradle.kts b/build.gradle.kts
index 38e5dce..5fa8d6b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -2,11 +2,11 @@ group = "com.github.imflog"
 version = "0.9.0-SNAPSHOT"
 
 plugins {
-    kotlin("jvm").version("1.3.50")
+    kotlin("jvm").version("1.3.71")
     id("java-gradle-plugin")
     id("com.gradle.plugin-publish") version "0.10.1"
     id("maven-publish")
-    id("com.github.ben-manes.versions") version "0.27.0"
+    id("com.github.ben-manes.versions") version "0.28.0"
 }
 
 val kotlinVersion: String? by extra {
@@ -21,7 +21,7 @@ repositories {
 }
 
 // Dependencies versions
-val confluentVersion = "5.3.1"
+val confluentVersion = "5.4.1"
 val avroVersion = "1.8.2"
 dependencies {
     implementation(gradleApi())
@@ -31,10 +31,10 @@ dependencies {
 }
 
 // Test versions
-val junitVersion = "5.5.2"
+val junitVersion = "5.6.1"
 val mockkVersion = "1.9.3"
-val wiremockVersion = "2.25.1"
-val assertJVersion = "3.14.0"
+val wiremockVersion = "2.26.3"
+val assertJVersion = "3.15.0"
 dependencies {
     testImplementation(gradleTestKit())
     testImplementation("org.junit.jupiter", "junit-jupiter-api", junitVersion)
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 5028f28..a2bf131 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/BasicAuthExtension.kt b/src/main/kotlin/com/github/imflog/schema/registry/BasicAuthExtension.kt
new file mode 100644
index 0000000..12b30b2
--- /dev/null
+++ b/src/main/kotlin/com/github/imflog/schema/registry/BasicAuthExtension.kt
@@ -0,0 +1,18 @@
+package com.github.imflog.schema.registry
+
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.Property
+import org.gradle.api.provider.Provider
+
+open class BasicAuthExtension(private val objects: ObjectFactory) {
+
+    val username: Property<String> = objects.property(String::class.java).apply {
+        convention("")
+    }
+    val password: Property<String> = objects.property(String::class.java).apply {
+        convention("")
+    }
+
+    val basicAuth: Provider<String> =
+        username.flatMap { usernameStr -> password.map { passwordStr -> "$usernameStr:$passwordStr" } }
+}
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/RegistryClientWrapper.kt b/src/main/kotlin/com/github/imflog/schema/registry/RegistryClientWrapper.kt
index bd41540..aa2a842 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/RegistryClientWrapper.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/RegistryClientWrapper.kt
@@ -13,22 +13,19 @@ object RegistryClientWrapper {
 
     private const val BASIC_AUTH_SOURCE: String = "USER_INFO"
 
-    fun client(url: String, auth: SchemaRegistryBasicAuthExtension): SchemaRegistryClient =
-        CachedSchemaRegistryClient(url, 100, getConfig(auth))
+    fun client(url: String, basicAuth: String): SchemaRegistryClient =
+        CachedSchemaRegistryClient(url, 100, getConfig(basicAuth))
 
     /**
      * Retrieves configuration from the plugin extension.
      * Note that BASIC_AUTH_CREDENTIALS_SOURCE is not configurable as the plugin only supports
      * a single schema registry URL, so there is no additional utility of the URL source.
      */
-    private fun getConfig(auth: SchemaRegistryBasicAuthExtension): Map<String, String> {
-        return if (auth.username == null || auth.password == null) {
-            mapOf()
-        } else {
-            mapOf(
-                SchemaRegistryClientConfig.BASIC_AUTH_CREDENTIALS_SOURCE to BASIC_AUTH_SOURCE,
-                SchemaRegistryClientConfig.USER_INFO_CONFIG to auth.getBasicAuthCredentials()
-            )
-        }
-    }
+    private fun getConfig(basicAuth: String): Map<String, String> = if (basicAuth == ":")
+        mapOf()
+    else
+        mapOf(
+            SchemaRegistryClientConfig.BASIC_AUTH_CREDENTIALS_SOURCE to BASIC_AUTH_SOURCE,
+            SchemaRegistryClientConfig.USER_INFO_CONFIG to basicAuth
+        )
 }
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryBasicAuthExtension.kt b/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryBasicAuthExtension.kt
deleted file mode 100644
index 832c858..0000000
--- a/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryBasicAuthExtension.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.github.imflog.schema.registry
-
-open class SchemaRegistryBasicAuthExtension {
-
-    var username: String? = null
-    var password: String? = null
-
-    fun getBasicAuthCredentials() = "${this.username}:${this.password}"
-}
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryExtension.kt b/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryExtension.kt
index e1f84ca..f5b3ac7 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryExtension.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryExtension.kt
@@ -1,6 +1,12 @@
 package com.github.imflog.schema.registry
 
-open class SchemaRegistryExtension {
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.Property
 
-    var url: String = "http://localhost:8081"
+open class SchemaRegistryExtension(objects: ObjectFactory) {
+
+    val url: Property<String> = objects.property(String::class.java).apply {
+        // Default value
+        convention("http://localhost:8081")
+    }
 }
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryPlugin.kt b/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryPlugin.kt
index 7afab31..117ce75 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryPlugin.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/SchemaRegistryPlugin.kt
@@ -2,14 +2,10 @@ package com.github.imflog.schema.registry
 
 import com.github.imflog.schema.registry.compatibility.CompatibilitySubjectExtension
 import com.github.imflog.schema.registry.compatibility.CompatibilityTask
-import com.github.imflog.schema.registry.compatibility.TEST_SCHEMAS_TASK
-import com.github.imflog.schema.registry.config.CONFIG_SUBJECTS_TASK
 import com.github.imflog.schema.registry.config.ConfigSubjectExtension
 import com.github.imflog.schema.registry.config.ConfigTask
-import com.github.imflog.schema.registry.download.DOWNLOAD_SCHEMAS_TASK
-import com.github.imflog.schema.registry.download.DownloadTask
 import com.github.imflog.schema.registry.download.DownloadSubjectExtension
-import com.github.imflog.schema.registry.register.REGISTER_SCHEMAS_TASK
+import com.github.imflog.schema.registry.download.DownloadTask
 import com.github.imflog.schema.registry.register.RegisterSchemasTask
 import com.github.imflog.schema.registry.register.RegisterSubjectExtension
 import org.gradle.api.Plugin
@@ -23,6 +19,10 @@ class SchemaRegistryPlugin : Plugin<Project> {
                 "schemaRegistry",
                 SchemaRegistryExtension::class.java
             )
+            val authExtension = extensions.create(
+                "credentials",
+                BasicAuthExtension::class.java
+            )
             val downloadExtension = extensions.create(
                 "download",
                 DownloadSubjectExtension::class.java
@@ -35,48 +35,38 @@ class SchemaRegistryPlugin : Plugin<Project> {
                 "compatibility",
                 CompatibilitySubjectExtension::class.java
             )
-            val authExtension = extensions.create(
-                "credentials",
-                SchemaRegistryBasicAuthExtension::class.java
-            )
             val configExtension = extensions.create(
                 "config",
                 ConfigSubjectExtension::class.java
             )
 
-            afterEvaluate {
-                tasks.create(
-                    DOWNLOAD_SCHEMAS_TASK, DownloadTask::class.java
-                ).apply {
-                    url = globalExtension.url
-                    basicAuth = authExtension
-                    subjects = downloadExtension.subjects
+            tasks.register(DownloadTask.TASK_NAME, DownloadTask::class.java)
+                .configure {
+                    it.url.set(globalExtension.url)
+                    it.basicAuth.set(authExtension.basicAuth)
+                    it.subjects.set(downloadExtension.subjects)
                 }
 
-                tasks.create(
-                    REGISTER_SCHEMAS_TASK, RegisterSchemasTask::class.java
-                ).apply {
-                    url = globalExtension.url
-                    auth = authExtension
-                    subjects = registerExtension.subjects
+            tasks.register(RegisterSchemasTask.TASK_NAME, RegisterSchemasTask::class.java)
+                .configure {
+                    it.url.set(globalExtension.url)
+                    it.basicAuth.set(authExtension.basicAuth)
+                    it.subjects.set(registerExtension.subjects)
                 }
 
-                tasks.create(
-                    TEST_SCHEMAS_TASK, CompatibilityTask::class.java
-                ).apply {
-                    url = globalExtension.url
-                    auth = authExtension
-                    subjects = compatibilityExtension.subjects
+            tasks.register(CompatibilityTask.TASK_NAME, CompatibilityTask::class.java)
+                .configure {
+                    it.url.set(globalExtension.url)
+                    it.basicAuth.set(authExtension.basicAuth)
+                    it.subjects.set(compatibilityExtension.subjects)
                 }
 
-                tasks.create(
-                    CONFIG_SUBJECTS_TASK, ConfigTask::class.java
-                ).apply {
-                    url = globalExtension.url
-                    auth = authExtension
-                    subjects = configExtension.subjects
+            tasks.register(ConfigTask.TASK_NAME, ConfigTask::class.java)
+                .configure {
+                    it.url.set(globalExtension.url)
+                    it.basicAuth.set(authExtension.basicAuth)
+                    it.subjects.set(configExtension.subjects)
                 }
-            }
         }
     }
 }
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilitySubjectExtension.kt b/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilitySubjectExtension.kt
index ae5db94..9fc2246 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilitySubjectExtension.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilitySubjectExtension.kt
@@ -1,13 +1,23 @@
 package com.github.imflog.schema.registry.compatibility
 
-open class CompatibilitySubjectExtension {
-    val subjects: ArrayList<Triple<String, String, List<String>>> = ArrayList()
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+
+
+open class CompatibilitySubjectExtension(objects: ObjectFactory) {
+    val subjects: ListProperty<CompatibilitySubject> = objects.listProperty(CompatibilitySubject::class.java)
 
     fun subject(inputSubject: String, file: String) {
-        subjects.add(Triple(inputSubject, file, emptyList()))
+        subjects.add(CompatibilitySubject(inputSubject, file, emptyList()))
     }
 
     fun subject(inputSubject: String, file: String, dependencies: List<String>) {
-        subjects.add(Triple(inputSubject, file, dependencies))
+        subjects.add(CompatibilitySubject(inputSubject, file, dependencies))
     }
-}
\ No newline at end of file
+}
+
+data class CompatibilitySubject(
+    val inputSubject: String,
+    val file: String,
+    val dependencies: List<String>
+)
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTask.kt b/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTask.kt
index 0844e5c..b149767 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTask.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTask.kt
@@ -1,34 +1,40 @@
 package com.github.imflog.schema.registry.compatibility
 
 import com.github.imflog.schema.registry.RegistryClientWrapper
-import com.github.imflog.schema.registry.SchemaRegistryBasicAuthExtension
 import org.gradle.api.DefaultTask
 import org.gradle.api.GradleScriptException
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+import org.gradle.api.provider.Property
 import org.gradle.api.tasks.Input
 import org.gradle.api.tasks.TaskAction
+import javax.inject.Inject
 
-const val TEST_SCHEMAS_TASK = "testSchemasTask"
 
-open class CompatibilityTask : DefaultTask() {
+open class CompatibilityTask @Inject constructor(objects: ObjectFactory) : DefaultTask() {
     init {
         group = "registry"
         description = "Test compatibility against registry"
     }
 
+    companion object {
+        const val TASK_NAME = "testSchemasTask"
+    }
+
     @Input
-    lateinit var url: String
+    val url: Property<String> = objects.property(String::class.java)
 
     @Input
-    lateinit var auth: SchemaRegistryBasicAuthExtension
+    val basicAuth: Property<String> = objects.property(String::class.java)
 
     @Input
-    lateinit var subjects: List<Triple<String, String, List<String>>>
+    val subjects: ListProperty<CompatibilitySubject> = objects.listProperty(CompatibilitySubject::class.java)
 
     @TaskAction
     fun testCompatibility() {
         val errorCount = CompatibilityTaskAction(
-            RegistryClientWrapper.client(url, auth),
-            subjects,
+            RegistryClientWrapper.client(url.get(), basicAuth.get()),
+            subjects.get(),
             project.rootDir
         ).run()
         if (errorCount > 0) {
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskAction.kt b/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskAction.kt
index a0bf72e..6f58b9e 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskAction.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskAction.kt
@@ -9,7 +9,7 @@ import java.io.File
 
 class CompatibilityTaskAction(
     private val client: SchemaRegistryClient,
-    private val subjects: List<Triple<String, String, List<String>>>,
+    private val subjects: List<CompatibilitySubject>,
     private val rootDir: File
 ) {
 
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigSubjectExtension.kt b/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigSubjectExtension.kt
index 03d0df2..0a250b3 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigSubjectExtension.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigSubjectExtension.kt
@@ -1,9 +1,17 @@
 package com.github.imflog.schema.registry.config
 
-open class ConfigSubjectExtension {
-    val subjects: ArrayList<Pair<String, String>> = ArrayList()
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+
+open class ConfigSubjectExtension(objects: ObjectFactory) {
+    val subjects: ListProperty<ConfigSubject> = objects.listProperty(ConfigSubject::class.java)
 
     fun subject(inputSubject: String, compatibility: String) {
-        subjects.add(Pair(inputSubject, compatibility))
+        subjects.add(ConfigSubject(inputSubject, compatibility))
     }
-}
\ No newline at end of file
+}
+
+data class ConfigSubject(
+    val inputSubject: String,
+    val compatibility: String
+)
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTask.kt b/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTask.kt
index aff9c18..37640e4 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTask.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTask.kt
@@ -1,48 +1,44 @@
 package com.github.imflog.schema.registry.config
 
 import com.github.imflog.schema.registry.RegistryClientWrapper
-import com.github.imflog.schema.registry.SchemaRegistryBasicAuthExtension
 import io.confluent.kafka.schemaregistry.avro.AvroCompatibilityLevel
 import org.gradle.api.DefaultTask
 import org.gradle.api.GradleScriptException
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+import org.gradle.api.provider.Property
 import org.gradle.api.tasks.Input
 import org.gradle.api.tasks.TaskAction
+import javax.inject.Inject
 
-const val CONFIG_SUBJECTS_TASK = "configSubjectsTask"
 
-open class ConfigTask : DefaultTask() {
+open class ConfigTask @Inject constructor(objects: ObjectFactory) : DefaultTask() {
     init {
         group = "registry"
         description = "Set subject compatibility in registry"
     }
 
+    companion object {
+        const val TASK_NAME = "configSubjectsTask"
+    }
+
     @Input
-    lateinit var url: String
+    val url: Property<String> = objects.property(String::class.java)
 
     @Input
-    lateinit var auth: SchemaRegistryBasicAuthExtension
+    val basicAuth: Property<String> = objects.property(String::class.java)
 
     @Input
-    lateinit var subjects: List<Pair<String, String>>
+    val subjects: ListProperty<ConfigSubject> = objects.listProperty(ConfigSubject::class.java)
 
     @TaskAction
     fun configureSubjects() {
-        // validate that subject pair includes a valid AvroCompatibilityValue:
-        // can't use the enum directly due to https://youtrack.jetbrains.net/issue/KT-31244
-        subjects.forEach { (_, compatibility) ->
-            try {
-                AvroCompatibilityLevel.valueOf(compatibility)
-            } catch (ex: IllegalArgumentException) {
-                throw GradleScriptException("'$compatibility' is not a valid schema registry compatibility", ex)
-            }
-        }
-
         val errorCount = ConfigTaskAction(
-            RegistryClientWrapper.client(url, auth),
-            subjects
+            RegistryClientWrapper.client(url.get(), basicAuth.get()),
+            subjects.get()
         ).run()
         if (errorCount > 0) {
             throw GradleScriptException("$errorCount subject configuration not set, see logs for details", Throwable())
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTaskAction.kt b/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTaskAction.kt
index 6280378..31e243a 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTaskAction.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/config/ConfigTaskAction.kt
@@ -1,22 +1,29 @@
 package com.github.imflog.schema.registry.config
 
+import io.confluent.kafka.schemaregistry.avro.AvroCompatibilityLevel
 import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
 import io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException
 import org.gradle.api.logging.Logging
 
 class ConfigTaskAction(
     private val client: SchemaRegistryClient,
-    private val subjectPairs: List<Pair<String, String>>
+    private val subjects: List<ConfigSubject>
 ) {
 
     private val logger = Logging.getLogger(ConfigTaskAction::class.java)
 
     fun run() : Int {
         var errorCount = 0
-        for ((subject, config) in subjectPairs) {
+        for ((subject, config) in subjects) {
             logger.debug("$subject: setting config $config")
             try {
+                // validate that subject pair includes a valid AvroCompatibilityValue:
+                // can't use the enum directly due to https://youtrack.jetbrains.net/issue/KT-31244
+                AvroCompatibilityLevel.valueOf(config)
                 client.updateCompatibility(subject, config)
+            } catch (ex: IllegalArgumentException) {
+                logger.error("'$config' is not a valid schema registry compatibility", ex)
+                errorCount++
             } catch (ex: RestClientException) {
                 logger.error("Error during compatibility update for $subject", ex)
                 errorCount++
@@ -24,4 +31,4 @@ class ConfigTaskAction(
         }
         return errorCount
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadSubjectExtension.kt b/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadSubjectExtension.kt
index 8f72a2d..329656d 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadSubjectExtension.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadSubjectExtension.kt
@@ -1,7 +1,12 @@
 package com.github.imflog.schema.registry.download
 
-open class DownloadSubjectExtension {
-    val subjects: MutableList<DownloadSubject> = ArrayList()
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+
+open class DownloadSubjectExtension(objects: ObjectFactory) {
+    val subjects: ListProperty<DownloadSubject> = objects.listProperty(DownloadSubject::class.java).apply {
+        convention(listOf())
+    }
 
     fun subject(inputSubject: String, file: String, version: Int) {
         subjects.add(DownloadSubject(inputSubject, file, version))
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTask.kt b/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTask.kt
index c7d885e..b7386ae 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTask.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTask.kt
@@ -1,34 +1,42 @@
 package com.github.imflog.schema.registry.download
 
 import com.github.imflog.schema.registry.RegistryClientWrapper
-import com.github.imflog.schema.registry.SchemaRegistryBasicAuthExtension
+import com.github.imflog.schema.registry.BasicAuthExtension
 import org.gradle.api.DefaultTask
 import org.gradle.api.GradleScriptException
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+import org.gradle.api.provider.Property
 import org.gradle.api.tasks.Input
 import org.gradle.api.tasks.TaskAction
+import javax.inject.Inject
 
-const val DOWNLOAD_SCHEMAS_TASK = "downloadSchemasTask"
 
-open class DownloadTask : DefaultTask() {
+open class DownloadTask @Inject constructor(objects: ObjectFactory) : DefaultTask() {
+
+    companion object {
+        const val TASK_NAME = "downloadSchemasTask"
+    }
+
     init {
         group = "registry"
         description = "Download schemas from the registry"
     }
 
     @Input
-    lateinit var subjects: List<DownloadSubject>
+    val url: Property<String> = objects.property(String::class.java)
 
     @Input
-    lateinit var basicAuth: SchemaRegistryBasicAuthExtension
+    val subjects: ListProperty<DownloadSubject> = objects.listProperty(DownloadSubject::class.java)
 
     @Input
-    lateinit var url: String
+    val basicAuth: Property<String> = objects.property(String::class.java)
 
     @TaskAction
     fun downloadSchemas() {
         val errorCount = DownloadTaskAction(
-            RegistryClientWrapper.client(url, basicAuth),
-            subjects,
+            RegistryClientWrapper.client(url.get(), basicAuth.get()),
+            subjects.get(),
             project.rootDir
         ).run()
         if (errorCount > 0) {
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTaskAction.kt b/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTaskAction.kt
index ad43d6f..7591027 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTaskAction.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/download/DownloadTaskAction.kt
@@ -7,7 +7,7 @@ import java.io.File
 
 class DownloadTaskAction(
     private val client: SchemaRegistryClient,
-    private val subjectPairs: List<DownloadSubject>,
+    private val subjects: List<DownloadSubject>,
     private val rootDir: File
 ) {
 
@@ -15,7 +15,7 @@ class DownloadTaskAction(
 
     fun run(): Int {
         var errorCount = 0
-        subjectPairs.forEach { downloadSubject ->
+        subjects.forEach { downloadSubject ->
             logger.info("Start loading schemas for ${downloadSubject.subject}")
             try {
                 val downloadedSchema = downloadSchema(downloadSubject)
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterSubjectExtension.kt b/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterSubjectExtension.kt
index 8035906..0ff8054 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterSubjectExtension.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterSubjectExtension.kt
@@ -1,13 +1,22 @@
 package com.github.imflog.schema.registry.register
 
-open class RegisterSubjectExtension {
-    val subjects: ArrayList<Triple<String, String, List<String>>> = ArrayList()
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+
+open class RegisterSubjectExtension(objects: ObjectFactory) {
+    val subjects: ListProperty<RegisterSubject> = objects.listProperty(RegisterSubject::class.java)
 
     fun subject(inputSubject: String, file: String) {
-        subjects.add(Triple(inputSubject, file, emptyList()))
+        subjects.add(RegisterSubject(inputSubject, file, emptyList()))
     }
 
     fun subject(inputSubject: String, file: String, dependencies: List<String>) {
-        subjects.add(Triple(inputSubject, file, dependencies))
+        subjects.add(RegisterSubject(inputSubject, file, dependencies))
     }
-}
\ No newline at end of file
+}
+
+data class RegisterSubject(
+    val inputSubject: String,
+    val file: String,
+    val dependencies: List<String>
+)
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTask.kt b/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTask.kt
index 0eb8e24..f5dfc0f 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTask.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTask.kt
@@ -1,40 +1,44 @@
 package com.github.imflog.schema.registry.register
 
 import com.github.imflog.schema.registry.RegistryClientWrapper
-import com.github.imflog.schema.registry.SchemaRegistryBasicAuthExtension
 import org.gradle.api.DefaultTask
 import org.gradle.api.GradleScriptException
+import org.gradle.api.model.ObjectFactory
+import org.gradle.api.provider.ListProperty
+import org.gradle.api.provider.Property
 import org.gradle.api.tasks.Input
 import org.gradle.api.tasks.TaskAction
+import javax.inject.Inject
 
-const val REGISTER_SCHEMAS_TASK = "registerSchemasTask"
+open class RegisterSchemasTask @Inject constructor(objects: ObjectFactory) : DefaultTask() {
+
+    companion object {
+        const val TASK_NAME = "registerSchemasTask"
+    }
 
-open class RegisterSchemasTask : DefaultTask() {
     init {
         group = "registry"
         description = "Register schemas in the registry"
     }
 
     @Input
-    lateinit var url: String
+    val url: Property<String> = objects.property(String::class.java)
 
     @Input
-    lateinit var auth: SchemaRegistryBasicAuthExtension
+    val basicAuth: Property<String> = objects.property(String::class.java)
 
     @Input
-    lateinit var subjects: List<Triple<String, String, List<String>>>
+    val subjects: ListProperty<RegisterSubject> = objects.listProperty(RegisterSubject::class.java)
 
     @TaskAction
     fun registerSchemas() {
         val errorCount = RegisterTaskAction(
-            RegistryClientWrapper.client(url, auth),
-            subjects,
+            RegistryClientWrapper.client(url.get(), basicAuth.get()),
+            subjects.get(),
             project.rootDir
         ).run()
         if (errorCount > 0) {
             throw GradleScriptException("$errorCount schemas not registered, see logs for details", Throwable())
         }
     }
-
-
 }
diff --git a/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTaskAction.kt b/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTaskAction.kt
index 75cde28..f0ccdbc 100644
--- a/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTaskAction.kt
+++ b/src/main/kotlin/com/github/imflog/schema/registry/register/RegisterTaskAction.kt
@@ -7,7 +7,7 @@ import java.io.File
 
 class RegisterTaskAction(
     private val client: SchemaRegistryClient,
-    private val subjects: List<Triple<String, String, List<String>>>,
+    private val subjects: List<RegisterSubject>,
     private val rootDir: File
 ) {
 


Test patch:
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/SchemaRegistryPluginTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/SchemaRegistryPluginTest.kt
index 1135ca7..eeca229 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/SchemaRegistryPluginTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/SchemaRegistryPluginTest.kt
@@ -1,8 +1,7 @@
 package com.github.imflog.schema.registry
 
-import com.github.imflog.schema.registry.download.DOWNLOAD_SCHEMAS_TASK
+import com.github.imflog.schema.registry.download.DownloadTask
 import org.assertj.core.api.Assertions
-import org.assertj.core.api.Assertions.assertThat
 import org.gradle.api.Project
 import org.gradle.internal.impldep.org.junit.rules.TemporaryFolder
 import org.gradle.testfixtures.ProjectBuilder
@@ -39,8 +38,8 @@ class SchemaRegistryPluginTest {
     @Test
     fun `plugin should add tasks when applied`() {
         project.afterEvaluate {
-            val downloadSchemaTask = project.tasks.getByName(DOWNLOAD_SCHEMAS_TASK)
-            assertThat(downloadSchemaTask).isNotNull()
+            val downloadSchemaTask = project.tasks.getByName(DownloadTask.TASK_NAME)
+            Assertions.assertThat(downloadSchemaTask).isNotNull()
         }
     }
 
@@ -65,9 +64,9 @@ class SchemaRegistryPluginTest {
 
         try {
             GradleRunner.create()
-                .withGradleVersion("5.6.4")
+                .withGradleVersion("6.2.2")
                 .withProjectDir(folderRule.root)
-                .withArguments(DOWNLOAD_SCHEMAS_TASK)
+                .withArguments(DownloadTask.TASK_NAME)
                 .withPluginClasspath()
                 .withDebug(true)
                 .build()
@@ -103,9 +102,9 @@ class SchemaRegistryPluginTest {
 
         try {
             GradleRunner.create()
-                .withGradleVersion("5.6.4")
+                .withGradleVersion("6.2.2")
                 .withProjectDir(folderRule.root)
-                .withArguments(DOWNLOAD_SCHEMAS_TASK)
+                .withArguments(DownloadTask.TASK_NAME)
                 .withPluginClasspath()
                 .withDebug(true)
                 .build()
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskActionTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskActionTest.kt
index 42ca4ed..603278a 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskActionTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskActionTest.kt
@@ -38,7 +38,8 @@ class CompatibilityTaskActionTest {
         registryClient.register("test", testSchema)
         folderRule.newFolder("src", "main", "avro", "external")
 
-        val subjects = arrayListOf(Triple("test", "src/main/avro/external/test.avsc", emptyList<String>()))
+        val subjects =
+            arrayListOf(CompatibilitySubject("test", "src/main/avro/external/test.avsc", emptyList()))
         File(folderRule.root, "src/main/avro/external/test.avsc").writeText(
             """
             {"type": "record",
@@ -109,7 +110,7 @@ class CompatibilityTaskActionTest {
 
 
         val subjects = listOf(
-            Triple(
+            CompatibilitySubject(
                 "test",
                 "src/main/avro/external/test.avsc",
                 listOf(
@@ -140,7 +141,8 @@ class CompatibilityTaskActionTest {
         registryClient.register("test", testSchema)
         folderRule.newFolder("src", "main", "avro", "external")
 
-        val subjects = arrayListOf(Triple("test", "src/main/avro/external/test.avsc", emptyList<String>()))
+        val subjects =
+            arrayListOf(CompatibilitySubject("test", "src/main/avro/external/test.avsc", emptyList()))
         File(folderRule.root, "src/main/avro/external/test.avsc").writeText(
             """
             {"type": "record",
@@ -174,7 +176,7 @@ class CompatibilityTaskActionTest {
 
         folderRule.newFolder("src", "main", "avro", "external")
 
-        val subjects = arrayListOf(Triple("test", "src/main/avro/external/test.avsc", emptyList<String>()))
+        val subjects = arrayListOf(CompatibilitySubject("test", "src/main/avro/external/test.avsc", emptyList()))
         File(folderRule.root, "src/main/avro/external/test.avsc").writeText(
             """
             {"type": "record",
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskTest.kt
index 6368e85..27c6620 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/compatibility/CompatibilityTaskTest.kt
@@ -65,9 +65,9 @@ class CompatibilityTaskTest {
         // Stub without authentication configuration
         wireMockServerItem.stubFor(
             WireMock.post(
-                WireMock
-                    .urlMatching("/compatibility/subjects/.*/versions/.*")
-            )
+                    WireMock
+                        .urlMatching("/compatibility/subjects/.*/versions/.*")
+                )
                 .willReturn(
                     WireMock.aResponse()
                         .withStatus(200)
@@ -79,9 +79,9 @@ class CompatibilityTaskTest {
         // Stub with authentication configuration
         wireMockAuthServerItem.stubFor(
             WireMock.post(
-                WireMock
-                    .urlMatching("/compatibility/subjects/.*/versions/.*")
-            )
+                    WireMock
+                        .urlMatching("/compatibility/subjects/.*/versions/.*")
+                )
                 .withBasicAuth(username, password)
                 .willReturn(
                     WireMock.aResponse()
@@ -142,9 +142,9 @@ class CompatibilityTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.2")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(TEST_SCHEMAS_TASK)
+            .withArguments(CompatibilityTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
@@ -207,9 +207,9 @@ class CompatibilityTaskTest {
         depAvsc.writeText(depSchema)
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.2")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(TEST_SCHEMAS_TASK)
+            .withArguments(CompatibilityTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
@@ -257,9 +257,9 @@ class CompatibilityTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.2")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(TEST_SCHEMAS_TASK)
+            .withArguments(CompatibilityTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .buildAndFail()
@@ -311,9 +311,9 @@ class CompatibilityTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.2")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(TEST_SCHEMAS_TASK)
+            .withArguments(CompatibilityTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskActionTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskActionTest.kt
index 33e0c0f..099b97a 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskActionTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskActionTest.kt
@@ -10,22 +10,25 @@ class ConfigTaskActionTest {
     fun `Should set subject config`() {
         // given
         val registryClient = MockSchemaRegistryClient()
-
-        val subjects = listOf(
-            Pair(
-                "test",
-                "FULL_TRANSITIVE"
-            )
-        )
+        val subjects = listOf(ConfigSubject("test", "FULL_TRANSITIVE"))
 
         // when
-        val errorCount = ConfigTaskAction(
-            registryClient,
-            subjects
-        ).run()
+        val errorCount = ConfigTaskAction(registryClient, subjects).run()
 
         // then
         Assertions.assertThat(errorCount).isEqualTo(0)
     }
 
-}
\ No newline at end of file
+    @Test
+    fun `Should fail if avro compatibility level does not exist`() {
+        // given
+        val registryClient = MockSchemaRegistryClient()
+        val subjects = listOf(ConfigSubject("test", "FOO"))
+
+        // when
+        val errorCount = ConfigTaskAction(registryClient, subjects).run()
+
+        // then
+        Assertions.assertThat(errorCount).isEqualTo(1)
+    }
+}
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskTest.kt
index 7bfaddc..22e2045 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/config/ConfigTaskTest.kt
@@ -119,9 +119,9 @@ class ConfigTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(CONFIG_SUBJECTS_TASK)
+            .withArguments(ConfigTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
@@ -150,9 +150,9 @@ class ConfigTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(CONFIG_SUBJECTS_TASK)
+            .withArguments(ConfigTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
@@ -180,9 +180,9 @@ class ConfigTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(CONFIG_SUBJECTS_TASK)
+            .withArguments(ConfigTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .buildAndFail()
@@ -211,9 +211,9 @@ class ConfigTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(CONFIG_SUBJECTS_TASK)
+            .withArguments(ConfigTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .buildAndFail()
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/download/DownloadTaskTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/download/DownloadTaskTest.kt
index e89e9e2..da10a12 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/download/DownloadTaskTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/download/DownloadTaskTest.kt
@@ -8,7 +8,7 @@ import com.github.tomakehurst.wiremock.client.WireMock
 import com.github.tomakehurst.wiremock.common.ConsoleNotifier
 import com.github.tomakehurst.wiremock.core.WireMockConfiguration
 import io.confluent.kafka.schemaregistry.client.rest.entities.Schema
-import org.assertj.core.api.Assertions.assertThat
+import org.assertj.core.api.Assertions
 import org.gradle.internal.impldep.org.junit.rules.TemporaryFolder
 import org.gradle.testkit.runner.BuildResult
 import org.gradle.testkit.runner.GradleRunner
@@ -151,16 +151,16 @@ class DownloadTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(DOWNLOAD_SCHEMAS_TASK)
+            .withArguments(DownloadTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
 
-        assertThat(File(folderRule.root, "src/main/avro/test")).exists()
-        assertThat(File(folderRule.root, "src/main/avro/test/test-subject.avsc")).exists()
-        assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
+        Assertions.assertThat(File(folderRule.root, "src/main/avro/test")).exists()
+        Assertions.assertThat(File(folderRule.root, "src/main/avro/test/test-subject.avsc")).exists()
+        Assertions.assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
     }
 
     @Test
@@ -183,16 +183,16 @@ class DownloadTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(DOWNLOAD_SCHEMAS_TASK)
+            .withArguments(DownloadTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
 
-        assertThat(File(folderRule.root, "src/main/avro/test")).exists()
-        assertThat(File(folderRule.root, "src/main/avro/test/test-subject.avsc")).exists()
-        assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
+        Assertions.assertThat(File(folderRule.root, "src/main/avro/test")).exists()
+        Assertions.assertThat(File(folderRule.root, "src/main/avro/test/test-subject.avsc")).exists()
+        Assertions.assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
     }
 
     @Test
@@ -215,13 +215,13 @@ class DownloadTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(DOWNLOAD_SCHEMAS_TASK)
+            .withArguments(DownloadTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .buildAndFail()
-        assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.FAILED)
+        Assertions.assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.FAILED)
     }
 
     @Test
@@ -244,13 +244,13 @@ class DownloadTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(DOWNLOAD_SCHEMAS_TASK)
+            .withArguments(DownloadTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .buildAndFail()
-        assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.FAILED)
+        Assertions.assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.FAILED)
     }
 
     @Test
@@ -273,17 +273,17 @@ class DownloadTaskTest {
         )
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(DOWNLOAD_SCHEMAS_TASK)
+            .withArguments(DownloadTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
 
-        assertThat(File(folderRule.root, "src/main/avro/test")).exists()
+        Assertions.assertThat(File(folderRule.root, "src/main/avro/test")).exists()
         val resultFile = File(folderRule.root, "src/main/avro/test/test-subject.avsc")
-        assertThat(resultFile).exists()
-        assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
-        assertThat(resultFile.readText()).contains("desc")
+        Assertions.assertThat(resultFile).exists()
+        Assertions.assertThat(result?.task(":downloadSchemasTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
+        Assertions.assertThat(resultFile.readText()).contains("desc")
     }
 }
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskActionTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskActionTest.kt
index 37e3748..28a2d71 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskActionTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskActionTest.kt
@@ -41,10 +41,10 @@ class RegisterTaskActionTest {
         )
 
         val subjects = listOf(
-            Triple(
+            RegisterSubject(
                 "test",
                 "src/main/avro/external/test.avsc",
-                listOf<String>()
+                listOf()
             )
         )
 
@@ -82,7 +82,7 @@ class RegisterTaskActionTest {
         )
 
         val subjects = listOf(
-            Triple(
+            RegisterSubject(
                 "test",
                 "src/main/avro/external/test.avsc",
                 listOf<String>()
@@ -149,7 +149,7 @@ class RegisterTaskActionTest {
 
 
         val subjects = listOf(
-            Triple(
+            RegisterSubject(
                 "test",
                 "src/main/avro/external/test.avsc",
                 listOf(
diff --git a/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskTest.kt b/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskTest.kt
index 60f174f..9abd5cc 100644
--- a/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskTest.kt
+++ b/src/test/kotlin/com/github/imflog/schema/registry/register/RegisterTaskTest.kt
@@ -87,7 +87,6 @@ class RegisterTaskTest {
                         .withBody("{\"id\": 1}")
                 )
         )
-
     }
 
     @AfterEach
@@ -122,7 +121,7 @@ class RegisterTaskTest {
         )
 
         folderRule.newFolder("avro")
-        var testAvsc = folderRule.newFile("avro/test.avsc")
+        val testAvsc = folderRule.newFile("avro/test.avsc")
         val schemaTest = """
             {
                 "type":"record",
@@ -137,10 +136,10 @@ class RegisterTaskTest {
         """.trimIndent()
         testAvsc.writeText(schemaTest)
 
-        var testAvsc2 = folderRule.newFile("avro/other_test.avsc")
+        val testAvsc2 = folderRule.newFile("avro/other_test.avsc")
         testAvsc2.writeText(schemaTest)
 
-        var depAvsc = folderRule.newFile("avro/dependency_test.avsc")
+        val depAvsc = folderRule.newFile("avro/dependency_test.avsc")
         val depSchema = """
             {
                 "type":"record",
@@ -156,9 +155,9 @@ class RegisterTaskTest {
         depAvsc.writeText(depSchema)
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(REGISTER_SCHEMAS_TASK)
+            .withArguments(RegisterSchemasTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
@@ -188,7 +187,7 @@ class RegisterTaskTest {
         )
 
         folderRule.newFolder("avro")
-        var testAvsc = folderRule.newFile("avro/test.avsc")
+        val testAvsc = folderRule.newFile("avro/test.avsc")
         val schemaTest = """
             {
                 "type":"record",
@@ -203,10 +202,10 @@ class RegisterTaskTest {
         """.trimIndent()
         testAvsc.writeText(schemaTest)
 
-        var testAvsc2 = folderRule.newFile("avro/other_test.avsc")
+        val testAvsc2 = folderRule.newFile("avro/other_test.avsc")
         testAvsc2.writeText(schemaTest)
 
-        var depAvsc = folderRule.newFile("avro/dependency_test.avsc")
+        val depAvsc = folderRule.newFile("avro/dependency_test.avsc")
         val depSchema = """
             {
                 "type":"record",
@@ -222,9 +221,9 @@ class RegisterTaskTest {
         depAvsc.writeText(depSchema)
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(REGISTER_SCHEMAS_TASK)
+            .withArguments(RegisterSchemasTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .build()
@@ -268,9 +267,9 @@ class RegisterTaskTest {
         testAvsc.writeText(schemaTest)
 
         val result: BuildResult? = GradleRunner.create()
-            .withGradleVersion("5.6.4")
+            .withGradleVersion("6.2.2")
             .withProjectDir(folderRule.root)
-            .withArguments(REGISTER_SCHEMAS_TASK)
+            .withArguments(RegisterSchemasTask.TASK_NAME)
             .withPluginClasspath()
             .withDebug(true)
             .buildAndFail()