Merge branch '5.1.x'
This commit is contained in:
commit
c95ffe3db2
|
|
@ -600,16 +600,16 @@ class OrderServiceIntegrationTests @Autowired constructor(
|
||||||
|
|
||||||
==== `PER_CLASS` Lifecycle
|
==== `PER_CLASS` Lifecycle
|
||||||
|
|
||||||
Kotlin lets you specify meaningful test function names between backticks (\`).
|
Kotlin lets you specify meaningful test function names between backticks (```).
|
||||||
As of JUnit 5, Kotlin test classes can use the `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`
|
As of JUnit 5, Kotlin test classes can use the `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`
|
||||||
annotation to enable a single instantiation of test classes, which allows the use of `@BeforeAll` and `@AfterAll`
|
annotation to enable a single instantiation of test classes, which allows the use of `@BeforeAll` and `@AfterAll`
|
||||||
annotations on non-static methods, which is a good fit for Kotlin.
|
annotations on non-static methods, which is a good fit for Kotlin.
|
||||||
|
|
||||||
You can now change the default behavior to `PER_CLASS` thanks to a
|
You can also change the default behavior to `PER_CLASS` thanks to a
|
||||||
`junit-platform.properties` file with a
|
`junit-platform.properties` file with a
|
||||||
`junit.jupiter.testinstance.lifecycle.default = per_class` property.
|
`junit.jupiter.testinstance.lifecycle.default = per_class` property.
|
||||||
|
|
||||||
The following example `@BeforeAll` and `@AfterAll` annotations on non-static methods:
|
The following example demonstrates `@BeforeAll` and `@AfterAll` annotations on non-static methods:
|
||||||
|
|
||||||
[source]
|
[source]
|
||||||
----
|
----
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue