• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package kotlinx.serialization
2 
3 import org.junit.Test
4 import kotlin.reflect.full.*
5 import kotlin.test.*
6 
7 class RetentionTest {
8 
9     @Serializable
10     class F(@SerialName("?") val a: Int, @Transient val b: Int = 42, @Required val c: Int)
11 
12     @Test
testRetentionnull13     fun testRetention() {
14         assertEquals("?", F::a.findAnnotation<SerialName>()?.value)
15         assertNotNull(F::b.findAnnotation<Transient>())
16         assertNotNull(F::c.findAnnotation<Required>())
17     }
18 }
19