Fix migration to asciidoctor tabs

The automation to asciidoctor tabs did not migrate properly for all
cases this commit fixes the migration.

See gh-30435
This commit is contained in:
Rob Winch
2023-05-05 20:19:47 -05:00
committed by rstoyanchev
parent 6930d4d531
commit 3a0a19cff8
72 changed files with 448 additions and 300 deletions

View File

@@ -19,11 +19,11 @@ Java::
// class body...
}
----
======
<1> Indicate that the `dev` profile should be active.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
@ActiveProfiles("dev") // <1>
@@ -32,6 +32,7 @@ Java::
}
----
<1> Indicate that the `dev` profile should be active.
======
The following example indicates that both the `dev` and the `integration` profiles should
@@ -49,11 +50,11 @@ Java::
// class body...
}
----
======
<1> Indicate that the `dev` and `integration` profiles should be active.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
@ActiveProfiles(["dev", "integration"]) // <1>
@@ -62,6 +63,7 @@ Java::
}
----
<1> Indicate that the `dev` and `integration` profiles should be active.
======
NOTE: `@ActiveProfiles` provides support for inheriting active bean definition profiles

View File

@@ -18,11 +18,11 @@ Java::
// logic to be run after a transaction has ended
}
----
======
<1> Run this method after a transaction.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@AfterTransaction // <1>
fun afterTransaction() {
@@ -30,5 +30,6 @@ Java::
}
----
<1> Run this method after a transaction.
======

View File

@@ -20,11 +20,11 @@ Java::
// logic to be run before a transaction is started
}
----
======
<1> Run this method before a transaction.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@BeforeTransaction // <1>
fun beforeTransaction() {
@@ -32,5 +32,6 @@ Java::
}
----
<1> Run this method before a transaction.
======

View File

@@ -21,11 +21,11 @@ Java::
// ...
}
----
======
<1> Commit the result of the test to the database.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@Commit // <1>
@Test
@@ -34,5 +34,6 @@ Java::
}
----
<1> Commit the result of the test to the database.
======

View File

@@ -26,11 +26,11 @@ Java::
// class body...
}
----
======
<1> Referring to an XML file.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration("/test-config.xml") // <1>
class XmlApplicationContextTests {
@@ -38,6 +38,7 @@ Java::
}
----
<1> Referring to an XML file.
======
The following example shows a `@ContextConfiguration` annotation that refers to a class:
@@ -53,11 +54,11 @@ Java::
// class body...
}
----
======
<1> Referring to a class.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration(classes = [TestConfig::class]) // <1>
class ConfigClassApplicationContextTests {
@@ -65,6 +66,7 @@ Java::
}
----
<1> Referring to a class.
======
As an alternative or in addition to declaring resource locations or component classes,
@@ -82,11 +84,11 @@ Java::
// class body...
}
----
======
<1> Declaring an initializer class.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration(initializers = [CustomContextInitializer::class]) // <1>
class ContextInitializerTests {
@@ -94,6 +96,7 @@ Java::
}
----
<1> Declaring an initializer class.
======
You can optionally use `@ContextConfiguration` to declare the `ContextLoader` strategy as
@@ -114,11 +117,11 @@ Java::
// class body...
}
----
======
<1> Configuring both a location and a custom loader.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration("/test-context.xml", loader = CustomContextLoader::class) // <1>
class CustomLoaderXmlApplicationContextTests {
@@ -126,6 +129,7 @@ Java::
}
----
<1> Configuring both a location and a custom loader.
======
NOTE: `@ContextConfiguration` provides support for inheriting resource locations or

View File

@@ -31,11 +31,11 @@ Java::
// some tests that require a new Spring container
}
----
======
<1> Dirty the context before the current test class.
+
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@DirtiesContext(classMode = BEFORE_CLASS) // <1>
class FreshContextTests {
@@ -43,6 +43,7 @@ Java::
}
----
<1> Dirty the context before the current test class.
======
* After the current test class, when declared on a class with class mode set to
`AFTER_CLASS` (i.e., the default class mode).
@@ -58,11 +59,11 @@ Java::
// some tests that result in the Spring container being dirtied
}
----
======
<1> Dirty the context after the current test class.
+
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@DirtiesContext // <1>
class ContextDirtyingTests {
@@ -70,6 +71,7 @@ Java::
}
----
<1> Dirty the context after the current test class.
======
* Before each test method in the current test class, when declared on a class with class
@@ -86,11 +88,11 @@ Java::
// some tests that require a new Spring container
}
----
======
<1> Dirty the context before each test method.
+
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@DirtiesContext(classMode = BEFORE_EACH_TEST_METHOD) // <1>
class FreshContextTests {
@@ -98,6 +100,7 @@ Java::
}
----
<1> Dirty the context before each test method.
======
* After each test method in the current test class, when declared on a class with class
@@ -114,11 +117,11 @@ Java::
// some tests that result in the Spring container being dirtied
}
----
======
<1> Dirty the context after each test method.
+
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD) // <1>
class ContextDirtyingTests {
@@ -126,6 +129,7 @@ Java::
}
----
<1> Dirty the context after each test method.
======
* Before the current test, when declared on a method with the method mode set to
@@ -143,11 +147,11 @@ Java::
// some logic that requires a new Spring container
}
----
======
<1> Dirty the context before the current test method.
+
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@DirtiesContext(methodMode = BEFORE_METHOD) // <1>
@Test
@@ -156,6 +160,7 @@ Java::
}
----
<1> Dirty the context before the current test method.
======
* After the current test, when declared on a method with the method mode set to
`AFTER_METHOD` (i.e., the default method mode).
@@ -172,11 +177,11 @@ Java::
// some logic that results in the Spring container being dirtied
}
----
======
<1> Dirty the context after the current test method.
+
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@DirtiesContext // <1>
@Test
@@ -185,6 +190,7 @@ Java::
}
----
<1> Dirty the context after the current test method.
======
If you use `@DirtiesContext` in a test whose context is configured as part of a context
@@ -220,11 +226,11 @@ Java::
}
}
----
======
<1> Use the current-level algorithm.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextHierarchy(
ContextConfiguration("/parent-config.xml"),
@@ -243,6 +249,7 @@ Java::
}
----
<1> Use the current-level algorithm.
======
For further details regarding the `EXHAUSTIVE` and `CURRENT_LEVEL` algorithms, see the

View File

@@ -29,13 +29,13 @@ Java::
// tests ...
}
----
======
<1> Annotate a `static` method with `@DynamicPropertySource`.
<2> Accept a `DynamicPropertyRegistry` as an argument.
<3> Register a dynamic `server.port` property to be retrieved lazily from the server.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
class MyIntegrationTests {
@@ -58,6 +58,7 @@ Java::
<1> Annotate a `static` method with `@DynamicPropertySource`.
<2> Accept a `DynamicPropertyRegistry` as an argument.
<3> Register a dynamic `server.port` property to be retrieved lazily from the server.
======
See xref:testing/testcontext-framework/ctx-management/dynamic-property-sources.adoc[Context Configuration with Dynamic Property Sources] for further details.

View File

@@ -27,11 +27,11 @@ Java::
// ...
}
----
======
<1> Do not roll back the result.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@Rollback(false) // <1>
@Test
@@ -40,5 +40,6 @@ Java::
}
----
<1> Do not roll back the result.
======

View File

@@ -17,11 +17,11 @@ Java::
// run code that relies on the test schema and test data
}
----
======
<1> Run two scripts for this test.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@Test
@Sql("/test-schema.sql", "/test-user-data.sql") // <1>
@@ -30,6 +30,7 @@ Java::
}
----
<1> Run two scripts for this test.
======
See xref:testing/testcontext-framework/executing-sql.adoc#testcontext-executing-sql-declaratively[Executing SQL scripts declaratively with @Sql] for further details.

View File

@@ -19,11 +19,11 @@ Java::
// run code that relies on the test data
}
----
======
<1> Set the comment prefix and the separator in SQL scripts.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@Test
@Sql("/test-user-data.sql", config = SqlConfig(commentPrefix = "`", separator = "@@")) // <1>
@@ -32,4 +32,5 @@ Java::
}
----
<1> Set the comment prefix and the separator in SQL scripts.
======

View File

@@ -22,11 +22,11 @@ Java::
// run code that uses the test schema and test data
}
----
======
<1> Declare a group of SQL scripts.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@Test
@SqlGroup( // <1>
@@ -37,6 +37,7 @@ Java::
}
----
<1> Declare a group of SQL scripts.
======

View File

@@ -29,11 +29,11 @@ Java::
}
}
----
======
<1> Set the `@Sql` merge mode to `MERGE` for all test methods in the class.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@SpringJUnitConfig(TestConfig::class)
@Sql("/test-schema.sql")
@@ -48,6 +48,7 @@ Java::
}
----
<1> Set the `@Sql` merge mode to `MERGE` for all test methods in the class.
======
The following example shows how to use `@SqlMergeMode` at the method level.
@@ -69,11 +70,11 @@ Java::
}
}
----
======
<1> Set the `@Sql` merge mode to `MERGE` for a specific test method.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@SpringJUnitConfig(TestConfig::class)
@Sql("/test-schema.sql")
@@ -88,5 +89,6 @@ Java::
}
----
<1> Set the `@Sql` merge mode to `MERGE` for a specific test method.
======

View File

@@ -20,11 +20,11 @@ Java::
// class body...
}
----
======
<1> Register two `TestExecutionListener` implementations.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
@TestExecutionListeners(CustomTestExecutionListener::class, AnotherTestExecutionListener::class) // <1>
@@ -33,11 +33,12 @@ Java::
}
----
<1> Register two `TestExecutionListener` implementations.
======
By default, `@TestExecutionListeners` provides support for inheriting listeners from
superclasses or enclosing classes. See
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] and the
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] and the
{api-spring-framework}/test/context/TestExecutionListeners.html[`@TestExecutionListeners`
javadoc] for an example and further details. If you discover that you need to switch
back to using the default `TestExecutionListener` implementations, see the note

View File

@@ -20,11 +20,11 @@ Java::
// class body...
}
----
======
<1> Get properties from `test.properties` in the root of the classpath.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
@TestPropertySource("/test.properties") // <1>
@@ -33,6 +33,7 @@ Java::
}
----
<1> Get properties from `test.properties` in the root of the classpath.
======
The following example demonstrates how to declare inlined properties:
@@ -49,11 +50,11 @@ Java::
// class body...
}
----
======
<1> Declare `timezone` and `port` properties.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
@TestPropertySource(properties = ["timezone = GMT", "port: 4242"]) // <1>
@@ -62,6 +63,7 @@ Java::
}
----
<1> Declare `timezone` and `port` properties.
======
See xref:testing/testcontext-framework/ctx-management/property-sources.adoc[Context Configuration with Test Property Sources] for examples and further details.

View File

@@ -25,11 +25,11 @@ Java::
// class body...
}
----
======
<1> The `@WebAppConfiguration` annotation.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
@WebAppConfiguration // <1>
@@ -38,6 +38,7 @@ Java::
}
----
<1> The `@WebAppConfiguration` annotation.
======
--
@@ -59,11 +60,11 @@ Java::
// class body...
}
----
======
<1> Specifying a classpath resource.
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@ContextConfiguration
@WebAppConfiguration("classpath:test-web-resources") // <1>
@@ -72,6 +73,7 @@ Java::
}
----
<1> Specifying a classpath resource.
======
--