From 8d859f026e564ab890b5aa11a0368684a8a25b07 Mon Sep 17 00:00:00 2001 From: Dmitry Sulman Date: Sat, 14 Jun 2025 17:47:17 +0300 Subject: [PATCH] Fix issues with Kotlin examples in Antora docs Signed-off-by: Dmitry Sulman --- .../devtools/MyContainersConfiguration.kt | 2 +- .../MyContainersConfiguration.kt | 2 +- .../MyContainers.kt | 41 +++++++++++++++++++ .../MyContainersConfiguration.kt | 2 +- .../launch}/MyApplication.kt | 2 +- .../launch/TestMyApplication.kt | 2 +- .../atdevelopmenttime/test}/MyApplication.kt | 2 +- .../test/MyContainersConfiguration.kt | 2 +- .../test/TestMyApplication.kt | 2 +- .../MyContainers.kt | 20 --------- .../MyPropertiesKotlin.kt | 1 + .../{ => nested}/Nested.kt | 2 +- .../SomeController.kt | 19 --------- 13 files changed, 51 insertions(+), 48 deletions(-) rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{ => devservices}/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt (91%) rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{ => devservices}/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt (92%) create mode 100644 spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{ => devservices}/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainersConfiguration.kt (87%) rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{testcontainers/atdevelopmenttime/test => devservices/testcontainers/atdevelopmenttime/launch}/MyApplication.kt (90%) rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{ => devservices}/testcontainers/atdevelopmenttime/launch/TestMyApplication.kt (88%) rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{testcontainers/atdevelopmenttime/launch => devservices/testcontainers/atdevelopmenttime/test}/MyApplication.kt (90%) rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{ => devservices}/testcontainers/atdevelopmenttime/test/MyContainersConfiguration.kt (91%) rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/{ => devservices}/testcontainers/atdevelopmenttime/test/TestMyApplication.kt (89%) delete mode 100644 spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt rename spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/{ => nested}/Nested.kt (94%) delete mode 100644 spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/SomeController.kt diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt index 8d3f9f4e89a4..c26ee1d13715 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.devtools +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.devtools import org.springframework.boot.devtools.restart.RestartScope import org.springframework.boot.test.context.TestConfiguration diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt similarity index 92% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt index 517924b6b662..c74eb3dc7805 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.dynamicproperties +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.dynamicproperties import org.springframework.boot.test.context.TestConfiguration import org.springframework.context.annotation.Bean diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt new file mode 100644 index 000000000000..1580b157e687 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.importingcontainerdeclarations + +import org.springframework.boot.testcontainers.service.connection.ServiceConnection +import org.testcontainers.containers.MongoDBContainer +import org.testcontainers.containers.Neo4jContainer +import org.testcontainers.junit.jupiter.Container + +interface MyContainers { + + companion object { + + @Container + @ServiceConnection + @JvmField + val mongoContainer = MongoDBContainer("mongo:5.0") + + @Container + @ServiceConnection + @JvmField + val neo4jContainer = Neo4jContainer("neo4j:5") + + } + +} + diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainersConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainersConfiguration.kt similarity index 87% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainersConfiguration.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainersConfiguration.kt index 0d0a3025a144..4076ce697c5b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainersConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainersConfiguration.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.importingcontainerdeclarations +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.importingcontainerdeclarations import org.springframework.boot.test.context.TestConfiguration import org.springframework.boot.testcontainers.context.ImportTestcontainers diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/MyApplication.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/launch/MyApplication.kt similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/MyApplication.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/launch/MyApplication.kt index 9633bcbefe7f..555b18362076 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/MyApplication.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/launch/MyApplication.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.test +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.launch import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.docs.features.springapplication.MyApplication diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/launch/TestMyApplication.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/launch/TestMyApplication.kt similarity index 88% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/launch/TestMyApplication.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/launch/TestMyApplication.kt index 4d0b6d3e9fe5..d1fc57ae2233 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/launch/TestMyApplication.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/launch/TestMyApplication.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.launch +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.launch import org.springframework.boot.fromApplication diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/launch/MyApplication.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/MyApplication.kt similarity index 90% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/launch/MyApplication.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/MyApplication.kt index 51c01332edea..567ecd7e529f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/launch/MyApplication.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/MyApplication.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.launch +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.test import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.docs.features.springapplication.MyApplication diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/MyContainersConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/MyContainersConfiguration.kt similarity index 91% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/MyContainersConfiguration.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/MyContainersConfiguration.kt index 438ecae841ad..d6bc2f743902 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/MyContainersConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/MyContainersConfiguration.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.test +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.test import org.springframework.boot.test.context.TestConfiguration import org.springframework.boot.testcontainers.service.connection.ServiceConnection diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/TestMyApplication.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/TestMyApplication.kt similarity index 89% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/TestMyApplication.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/TestMyApplication.kt index d00b753016d6..cd4f622e71c2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/test/TestMyApplication.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/devservices/testcontainers/atdevelopmenttime/test/TestMyApplication.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.test +package org.springframework.boot.docs.features.devservices.testcontainers.atdevelopmenttime.test import org.springframework.boot.fromApplication import org.springframework.boot.with diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt deleted file mode 100644 index 0e91d6032e97..000000000000 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/importingcontainerdeclarations/MyContainers.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.importingcontainerdeclarations - -class MyContainers { -} diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/MyPropertiesKotlin.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/MyPropertiesKotlin.kt index c346834c1a51..b4071c72e86d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/MyPropertiesKotlin.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/MyPropertiesKotlin.kt @@ -18,6 +18,7 @@ package org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfi import org.springframework.boot.context.properties.ConfigurationProperties import org.springframework.boot.context.properties.NestedConfigurationProperty +import org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfigurationproperties.nested.Nested @ConfigurationProperties("my.properties") data class MyPropertiesKotlin( diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/Nested.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/nested/Nested.kt similarity index 94% rename from spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/Nested.kt rename to spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/nested/Nested.kt index 94842967c830..b00bf19ae3df 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/Nested.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/packaging/nativeimage/advanced/nestedconfigurationproperties/nested/Nested.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfigurationproperties +package org.springframework.boot.docs.packaging.nativeimage.advanced.nestedconfigurationproperties.nested class Nested { } diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/SomeController.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/SomeController.kt deleted file mode 100644 index 9c70b9de5ac8..000000000000 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/SomeController.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorpageswithoutspringmvc - -class SomeController