
jvmTest.kotlinx.serialization.RetentionTest.kt Maven / Gradle / Ivy
package kotlinx.serialization
import org.junit.Test
import kotlin.reflect.full.*
import kotlin.test.*
class RetentionTest {
@Serializable
class F(@SerialName("?") val a: Int, @Transient val b: Int = 42, @Required val c: Int)
@Test
fun testRetention() {
assertEquals("?", F::a.findAnnotation()?.value)
assertNotNull(F::b.findAnnotation())
assertNotNull(F::c.findAnnotation())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy