@@ -597,7 +597,7 @@ is https://junit.org/junit5/[JUnit 5], as well as https://mockk.io/[Mockk] for m
597
597
==== Constructor injection
598
598
599
599
As described in the <<testing#testcontext-junit-jupiter-di#spring-web-reactive,dedicated section>>, JUnit 5 allows
600
- constructor injection of beans which is pretty useful with Kotlin in order to use `val` instead of `lateinit var `.
600
+ constructor injection of beans which is pretty useful with Kotlin in order to use `val` instead of `lateinit var`.
601
601
602
602
603
603
====
@@ -619,8 +619,8 @@ You can also use `@Autowired` at constructor level to autowire all parameters.
619
619
----
620
620
@SpringJUnitConfig(TestConfig::class)
621
621
class OrderServiceIntegrationTests @Autowired constructor(
622
- val orderService: OrderService,
623
- val customerService: CustomerService) {
622
+ val orderService: OrderService,
623
+ val customerService: CustomerService) {
624
624
625
625
// tests that use the injected OrderService and CustomerService
626
626
}
@@ -630,16 +630,16 @@ class OrderServiceIntegrationTests @Autowired constructor(
630
630
631
631
==== `PER_CLASS` Lifecycle
632
632
633
- Kotlin lets you specify meaningful test function names between backticks (\ `).
633
+ Kotlin lets you specify meaningful test function names between backticks (`` `).
634
634
As of JUnit 5, Kotlin test classes can use the `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`
635
635
annotation to enable a single instantiation of test classes, which allows the use of `@BeforeAll` and `@AfterAll`
636
636
annotations on non-static methods, which is a good fit for Kotlin.
637
637
638
- You can now change the default behavior to `PER_CLASS` thanks to a
638
+ You can also change the default behavior to `PER_CLASS` thanks to a
639
639
`junit-platform.properties` file with a
640
640
`junit.jupiter.testinstance.lifecycle.default = per_class` property.
641
641
642
- The following example `@BeforeAll` and `@AfterAll` annotations on non-static methods:
642
+ The following example demonstrates `@BeforeAll` and `@AfterAll` annotations on non-static methods:
643
643
644
644
====
645
645
[source]
0 commit comments