diff --git a/_itest/builder-itest/src/main/kotlin/MyCustomAnnotationSpec.kt b/_itest/builder-itest/src/main/kotlin/MyCustomAnnotationSpec.kt index 6bc1138..016a654 100644 --- a/_itest/builder-itest/src/main/kotlin/MyCustomAnnotationSpec.kt +++ b/_itest/builder-itest/src/main/kotlin/MyCustomAnnotationSpec.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.itest @@ -9,6 +8,7 @@ import io.toolisticon.kotlin.generation.KotlinCodeGeneration.buildFile import io.toolisticon.kotlin.generation.itest.KotlinCodeGenerationITestConfig.ROOT_PACKAGE +@OptIn(ExperimentalKotlinPoetApi::class) object MyCustomAnnotationSpec { val name = ClassName(ROOT_PACKAGE, "MyCustomAnnotation") diff --git a/_itest/builder-itest/src/test/kotlin/HelloWorldExampleITest.kt b/_itest/builder-itest/src/test/kotlin/HelloWorldExampleITest.kt index 17abacf..9f7511c 100644 --- a/_itest/builder-itest/src/test/kotlin/HelloWorldExampleITest.kt +++ b/_itest/builder-itest/src/test/kotlin/HelloWorldExampleITest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) package io.toolisticon.kotlin.generation.itest @@ -14,6 +13,7 @@ import org.assertj.core.api.Assertions.assertThat import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) internal class HelloWorldExampleITest { @Test diff --git a/_itest/builder-itest/src/test/kotlin/KotlinFileSpecITest.kt b/_itest/builder-itest/src/test/kotlin/KotlinFileSpecITest.kt index 6348c15..c6cea9b 100644 --- a/_itest/builder-itest/src/test/kotlin/KotlinFileSpecITest.kt +++ b/_itest/builder-itest/src/test/kotlin/KotlinFileSpecITest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) package io.toolisticon.kotlin.generation.itest import com.squareup.kotlinpoet.ClassName @@ -8,6 +7,7 @@ import io.toolisticon.kotlin.generation.builder.KotlinFileSpecBuilder import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) internal class KotlinFileSpecITest { @Target(AnnotationTarget.FILE) diff --git a/_itest/builder-itest/src/test/kotlin/MyCustomAnnotationSpecITest.kt b/_itest/builder-itest/src/test/kotlin/MyCustomAnnotationSpecITest.kt index 8da29c9..2364625 100644 --- a/_itest/builder-itest/src/test/kotlin/MyCustomAnnotationSpecITest.kt +++ b/_itest/builder-itest/src/test/kotlin/MyCustomAnnotationSpecITest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) package io.toolisticon.kotlin.generation.itest @@ -17,6 +16,7 @@ import org.junit.jupiter.api.Test import kotlin.reflect.KClass import io.toolisticon.kotlin.generation.test.KotlinCodeGenerationTest.assertThat as assertThatCompilation +@OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) internal class MyCustomAnnotationSpecITest { @Test diff --git a/_itest/spi-itest/src/test/kotlin/SpiITest.kt b/_itest/spi-itest/src/test/kotlin/SpiITest.kt index 9ff6868..c371675 100644 --- a/_itest/spi-itest/src/test/kotlin/SpiITest.kt +++ b/_itest/spi-itest/src/test/kotlin/SpiITest.kt @@ -1,5 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) - package io.toolisticon.kotlin.generation.itest.spi import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi @@ -15,6 +13,7 @@ import org.assertj.core.api.Assertions.assertThatThrownBy import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class, ExperimentalCompilerApi::class) internal class SpiITest { @Test diff --git a/kotlin-code-generation-test/src/main/kotlin/KotlinCodeGenerationTest.kt b/kotlin-code-generation-test/src/main/kotlin/KotlinCodeGenerationTest.kt index 2417b79..63f4c60 100644 --- a/kotlin-code-generation-test/src/main/kotlin/KotlinCodeGenerationTest.kt +++ b/kotlin-code-generation-test/src/main/kotlin/KotlinCodeGenerationTest.kt @@ -1,5 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) - package io.toolisticon.kotlin.generation.test import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi @@ -34,6 +32,7 @@ import java.io.ByteArrayOutputStream * ``` */ @ExperimentalCompilerApi +@ExperimentalKotlinPoetApi object KotlinCodeGenerationTest { fun assertThat(actual: KotlinCompilationResult): KotlinCompilationAssert = KotlinCompilationAssert(actual) diff --git a/kotlin-code-generation/src/test/kotlin/KotlinCodeGenerationTest.kt b/kotlin-code-generation/src/test/kotlin/KotlinCodeGenerationTest.kt index 0708f3f..1f3f2ae 100644 --- a/kotlin-code-generation/src/test/kotlin/KotlinCodeGenerationTest.kt +++ b/kotlin-code-generation/src/test/kotlin/KotlinCodeGenerationTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation @@ -18,6 +17,7 @@ import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinCodeGenerationTest { @Nested diff --git a/kotlin-code-generation/src/test/kotlin/TestFixtures.kt b/kotlin-code-generation/src/test/kotlin/TestFixtures.kt index 3a3358a..e78c2b4 100644 --- a/kotlin-code-generation/src/test/kotlin/TestFixtures.kt +++ b/kotlin-code-generation/src/test/kotlin/TestFixtures.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation @@ -21,6 +20,7 @@ import java.time.Instant import java.util.* import kotlin.reflect.KClass +@OptIn(ExperimentalKotlinPoetApi::class) object TestFixtures { // a fixed instant to be used in test with diff --git a/kotlin-code-generation/src/test/kotlin/_test/MutableSpiRegistry.kt b/kotlin-code-generation/src/test/kotlin/_test/MutableSpiRegistry.kt index d9ff9ca..8b6a79e 100644 --- a/kotlin-code-generation/src/test/kotlin/_test/MutableSpiRegistry.kt +++ b/kotlin-code-generation/src/test/kotlin/_test/MutableSpiRegistry.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation._test @@ -10,6 +9,7 @@ import io.toolisticon.kotlin.generation.spi.processor.KotlinCodeGenerationProces import io.toolisticon.kotlin.generation.spi.strategy.KotlinCodeGenerationStrategyList import kotlin.reflect.KClass +@OptIn(ExperimentalKotlinPoetApi::class) class MutableSpiRegistry( val strategyList: MutableList = mutableListOf(), val processorList: MutableList = mutableListOf(), diff --git a/kotlin-code-generation/src/test/kotlin/_test/TestContext.kt b/kotlin-code-generation/src/test/kotlin/_test/TestContext.kt index 39c76e3..4011999 100644 --- a/kotlin-code-generation/src/test/kotlin/_test/TestContext.kt +++ b/kotlin-code-generation/src/test/kotlin/_test/TestContext.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation._test @@ -6,6 +5,7 @@ import com.squareup.kotlinpoet.ClassName import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi import io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationContext +@OptIn(ExperimentalKotlinPoetApi::class) class TestContext( val rootClassName: ClassName, override val registry: MutableSpiRegistry diff --git a/kotlin-code-generation/src/test/kotlin/_test/TestDeclarationFileStrategy.kt b/kotlin-code-generation/src/test/kotlin/_test/TestDeclarationFileStrategy.kt index afd8147..69499f3 100644 --- a/kotlin-code-generation/src/test/kotlin/_test/TestDeclarationFileStrategy.kt +++ b/kotlin-code-generation/src/test/kotlin/_test/TestDeclarationFileStrategy.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation._test @@ -8,6 +7,7 @@ import io.toolisticon.kotlin.generation.KotlinCodeGeneration.buildFile import io.toolisticon.kotlin.generation.spec.KotlinFileSpec import io.toolisticon.kotlin.generation.spi.strategy.KotlinFileSpecStrategy +@OptIn(ExperimentalKotlinPoetApi::class) class TestDeclarationFileStrategy : KotlinFileSpecStrategy( contextType = TestContext::class, TestDeclaration::class ) { diff --git a/kotlin-code-generation/src/test/kotlin/poet/KDocTest.kt b/kotlin-code-generation/src/test/kotlin/poet/KDocTest.kt index 0ef7657..229a6e7 100644 --- a/kotlin-code-generation/src/test/kotlin/poet/KDocTest.kt +++ b/kotlin-code-generation/src/test/kotlin/poet/KDocTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.poet @@ -7,6 +6,7 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KDocTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/poet/TypeSpecBuilderTest.kt b/kotlin-code-generation/src/test/kotlin/poet/TypeSpecBuilderTest.kt index 4641670..07d7e7c 100644 --- a/kotlin-code-generation/src/test/kotlin/poet/TypeSpecBuilderTest.kt +++ b/kotlin-code-generation/src/test/kotlin/poet/TypeSpecBuilderTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.poet @@ -10,6 +9,7 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class TypeSpecBuilderTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationClassTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationClassTest.kt index c3f8896..f003408 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationClassTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationClassTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -8,6 +7,7 @@ import io.toolisticon.kotlin.generation.KotlinCodeGeneration.buildAnnotationClas import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinAnnotationClassTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationTest.kt index 7c8b882..954585f 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinAnnotationTest.kt @@ -1,5 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) - package io.toolisticon.kotlin.generation.spec import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi @@ -11,6 +9,7 @@ import org.junit.jupiter.api.Test import kotlin.reflect.KClass +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinAnnotationTest { annotation class Foo( @@ -29,13 +28,13 @@ internal class KotlinAnnotationTest { assertThat(annotation.code).isEqualTo("""@io.toolisticon.kotlin.generation.TestFixtures.MyAnnotation(name = "foo", type = kotlin.String::class)"""); } - @Test - fun `create Foo annotation`() { + fun `create Foo annotation - multiline`() { val spec = KotlinAnnotationSpecBuilder.builder(Foo::class) .addMember("bar = %S", "hello world") .addStringMember("x", "foo") .addKClassMember("type", Long::class) + .multiLine() .build() assertThat(spec.code).isEqualTo("""@io.toolisticon.kotlin.generation.spec.KotlinAnnotationTest.Foo(bar = "hello world", x = "foo", type = kotlin.Long::class)""") @@ -52,6 +51,28 @@ internal class KotlinAnnotationTest { ) } + @Test + fun `create Foo annotation - singleline`() { + val spec = KotlinAnnotationSpecBuilder.builder(Foo::class) + .addMember("bar = %S", "hello world") + .addStringMember("x", "foo") + .addKClassMember("type", Long::class) + .build() + + assertThat(spec.code).isEqualTo("""@io.toolisticon.kotlin.generation.spec.KotlinAnnotationTest.Foo(bar = "hello world", x = "foo", type = kotlin.Long::class)""") + assertThat(spec.members).hasSize(1) + + assertThat(spec).hasToString( + "KotlinAnnotationSpec(" + + "typeName=io.toolisticon.kotlin.generation.spec.KotlinAnnotationTest.Foo, " + + "members=[" + + "bar = \"hello world\", " + + "x = \"foo\", " + + "type = kotlin.Long::class]" + + ")" + ) + } + @Test fun `use toBuilder to add members`() { var spec = KotlinAnnotationSpecBuilder.builder(Foo::class) diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinAnonymousClassTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinAnonymousClassTest.kt index 046b7a2..ae0649d 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinAnonymousClassTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinAnonymousClassTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -8,6 +7,7 @@ import io.toolisticon.kotlin.generation.KotlinCodeGeneration.buildFun import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinAnonymousClassTest { @Test fun build() { diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinCompanionObjectTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinCompanionObjectTest.kt index 89a3b40..cdb5ef1 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinCompanionObjectTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinCompanionObjectTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -10,6 +9,7 @@ import io.toolisticon.kotlin.generation.KotlinCodeGeneration.format.FORMAT_STRIN import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinCompanionObjectTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinConstructorPropertyTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinConstructorPropertyTest.kt index f0a1441..f86f111 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinConstructorPropertyTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinConstructorPropertyTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -8,6 +7,7 @@ import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Assumptions.assumeTrue import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinConstructorPropertyTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinDataClassTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinDataClassTest.kt index e744c4f..8c3d686 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinDataClassTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinDataClassTest.kt @@ -1,5 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) - package io.toolisticon.kotlin.generation.spec import com.squareup.kotlinpoet.ClassName @@ -11,6 +9,7 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinDataClassTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinEnumClassTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinEnumClassTest.kt index de6b36b..556314e 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinEnumClassTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinEnumClassTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinEnumClassTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinFileTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinFileTest.kt index 63dc18f..1a50c31 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinFileTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinFileTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinFileTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinFunTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinFunTest.kt index 7b90a3c..d0d8db6 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinFunTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinFunTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinFunTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinInterfaceTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinInterfaceTest.kt index 546c57c..3f474ed 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinInterfaceTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinInterfaceTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinInterfaceTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinObjectTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinObjectTest.kt index 0487b81..0862dd8 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinObjectTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinObjectTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinObjectTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinParameterTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinParameterTest.kt index f694b45..672bfa5 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinParameterTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinParameterTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinParameterTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinPropertyTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinPropertyTest.kt index 9ca283b..f93c58f 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinPropertyTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinPropertyTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinPropertyTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinTypeAliasTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinTypeAliasTest.kt index c23b0f2..b428222 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinTypeAliasTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinTypeAliasTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spec @@ -7,6 +6,7 @@ import io.toolisticon.kotlin.generation.TestFixtures.notDeprecated import org.junit.jupiter.api.Assumptions.assumeFalse import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) @Deprecated("not implemented yet") internal class KotlinTypeAliasTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spec/KotlinValueClassTest.kt b/kotlin-code-generation/src/test/kotlin/spec/KotlinValueClassTest.kt index e77ff0a..65e1f9a 100644 --- a/kotlin-code-generation/src/test/kotlin/spec/KotlinValueClassTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spec/KotlinValueClassTest.kt @@ -1,5 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) - package io.toolisticon.kotlin.generation.spec import com.squareup.kotlinpoet.ClassName @@ -9,6 +7,7 @@ import io.toolisticon.kotlin.generation.TestFixtures import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinValueClassTest { @Test diff --git a/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationServiceRepositoryTest.kt b/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationServiceRepositoryTest.kt index 56fc63b..c72b324 100644 --- a/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationServiceRepositoryTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationServiceRepositoryTest.kt @@ -1,5 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) - package io.toolisticon.kotlin.generation.spi import com.squareup.kotlinpoet.ExperimentalKotlinPoetApi @@ -7,12 +5,13 @@ import io.toolisticon.kotlin.generation.KotlinCodeGeneration import io.toolisticon.kotlin.generation.spec.KotlinDataClassSpec import io.toolisticon.kotlin.generation.spi.context.KotlinCodeGenerationContextBase import io.toolisticon.kotlin.generation.spi.registry.KotlinCodeGenerationServiceRepository -import io.toolisticon.kotlin.generation.spi.strategy.KotlinDataClassSpecStrategy import io.toolisticon.kotlin.generation.spi.strategy.KotlinCodeGenerationStrategyList +import io.toolisticon.kotlin.generation.spi.strategy.KotlinDataClassSpecStrategy import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import kotlin.reflect.KClass +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinCodeGenerationServiceRepositoryTest { class TestContext(registry: KotlinCodeGenerationSpiRegistry) : KotlinCodeGenerationContextBase(registry) { diff --git a/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationStrategyListTest.kt b/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationStrategyListTest.kt index 28f6ae4..58bcdde 100644 --- a/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationStrategyListTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spi/KotlinCodeGenerationStrategyListTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spi @@ -18,6 +17,7 @@ import io.toolisticon.kotlin.generation.spi.strategy.executeSingle import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) class KotlinCodeGenerationStrategyListTest { class AStrategy : DataClassAStrategy() { diff --git a/kotlin-code-generation/src/test/kotlin/spi/ServiceLoaderTestClassLoaderTest.kt b/kotlin-code-generation/src/test/kotlin/spi/ServiceLoaderTestClassLoaderTest.kt index f5d5e65..64d3e82 100644 --- a/kotlin-code-generation/src/test/kotlin/spi/ServiceLoaderTestClassLoaderTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spi/ServiceLoaderTestClassLoaderTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spi @@ -8,6 +7,7 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import java.util.ServiceLoader +@OptIn(ExperimentalKotlinPoetApi::class) class ServiceLoaderTestClassLoaderTest { interface MyInterface { diff --git a/kotlin-code-generation/src/test/kotlin/spi/processor/KotlinAnnotationClassSpecProcessorTest.kt b/kotlin-code-generation/src/test/kotlin/spi/processor/KotlinAnnotationClassSpecProcessorTest.kt index 6b9081b..61e1f75 100644 --- a/kotlin-code-generation/src/test/kotlin/spi/processor/KotlinAnnotationClassSpecProcessorTest.kt +++ b/kotlin-code-generation/src/test/kotlin/spi/processor/KotlinAnnotationClassSpecProcessorTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.spi.processor @@ -12,6 +11,7 @@ import io.toolisticon.kotlin.generation.spec.toFileSpec import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class KotlinAnnotationClassSpecProcessorTest { class AddRetentionProcessor : KotlinAnnotationClassSpecProcessor( diff --git a/kotlin-code-generation/src/test/kotlin/support/SuppressAnnotationTest.kt b/kotlin-code-generation/src/test/kotlin/support/SuppressAnnotationTest.kt index 867f182..d53fc54 100644 --- a/kotlin-code-generation/src/test/kotlin/support/SuppressAnnotationTest.kt +++ b/kotlin-code-generation/src/test/kotlin/support/SuppressAnnotationTest.kt @@ -1,4 +1,3 @@ -@file:OptIn(ExperimentalKotlinPoetApi::class) package io.toolisticon.kotlin.generation.support @@ -9,6 +8,7 @@ import io.toolisticon.kotlin.generation.KotlinCodeGeneration.builder.fileBuilder import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +@OptIn(ExperimentalKotlinPoetApi::class) internal class SuppressAnnotationTest { private val className = ClassName("foo", "Bar") private val typeBuilder = classBuilder(className)