https://kotlinlang.org logo
j

jan.rabe

01/22/2017, 11:05 AM
so the following works, however anyone know if the same would be possible by passing a generic instead of class parameter in kotlin?
Copy code
open class SerializableTest(var kClass: KClass<*>) : BaseTest() {

    open var expectedJson: String = ""

    @Test
    fun serialize() {
        val actual = getGson().fromJson(expectedJson, kClass::class.java)
        Assert.assertNotNull(actual)
    }
}