aboutsummaryrefslogtreecommitdiff
path: root/plugins/kotlin-as-java/src/test/kotlin/JvmFieldTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/kotlin-as-java/src/test/kotlin/JvmFieldTest.kt')
-rw-r--r--plugins/kotlin-as-java/src/test/kotlin/JvmFieldTest.kt30
1 files changed, 29 insertions, 1 deletions
diff --git a/plugins/kotlin-as-java/src/test/kotlin/JvmFieldTest.kt b/plugins/kotlin-as-java/src/test/kotlin/JvmFieldTest.kt
index 2f490421..99ea017b 100644
--- a/plugins/kotlin-as-java/src/test/kotlin/JvmFieldTest.kt
+++ b/plugins/kotlin-as-java/src/test/kotlin/JvmFieldTest.kt
@@ -5,6 +5,7 @@ import org.jetbrains.dokka.model.JavaVisibility
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
+import kotlin.test.assertNull
class JvmFieldTest : BaseAbstractTest() {
val configuration = dokkaConfiguration {
@@ -78,4 +79,31 @@ class JvmFieldTest : BaseAbstractTest() {
}
}
}
-} \ No newline at end of file
+
+ @Test
+ fun `object jvmfield property should have no getters`(){
+ testInline(
+ """
+ |/src/main/kotlin/kotlinAsJavaPlugin/sample.kt
+ |package kotlinAsJavaPlugin
+ |object MyObject {
+ | @JvmField
+ | val property: String = TODO()
+ |}
+ """.trimMargin(),
+ configuration,
+ ) {
+ documentablesTransformationStage = { module ->
+ val classLike = module.packages.flatMap { it.classlikes }.first()
+ val property = classLike.properties.singleOrNull { it.name == "property" }
+ assertNotNull(property)
+ assertEquals(
+ emptyList(),
+ classLike.functions.map { it.name }
+ )
+ assertNull(property.getter)
+ assertNull(property.setter)
+ }
+ }
+ }
+}