GH-876 - Mention test starter in testing reference documentation chapter.

This commit is contained in:
Oliver Drotbohm
2024-10-14 17:32:09 +02:00
parent 439f134b97
commit f2c538cd25

View File

@@ -2,9 +2,20 @@
= Integration Testing Application Modules
Spring Modulith allows to run integration tests bootstrapping individual application modules in isolation or combination with others.
To achieve this, place JUnit test class in an application module package or any sub-package of that and annotate it with `@ApplicationModuleTest`:
To achieve this, add the Spring Modulith test starter to your project like this
.A application module integration test class
[source, xml]
----
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-starter-test</artifactId>
<scope>test</scope>
</dependency>
----
and place a JUnit test class in an application module package or any sub-package of that and annotate it with `@ApplicationModuleTest`:
.An application module integration test class
[tabs]
======
Java::
@@ -36,7 +47,7 @@ class OrderIntegrationTests {
This will run your integration test similar to what `@SpringBootTest` would have achieved but with the bootstrap actually limited to the application module the test resides in.
If you configure the log level for `org.springframework.modulith` to `DEBUG`, you will see detailed information about how the test execution customizes the Spring Boot bootstrap:
.The log output of a application module integration test bootstrap
.The log output of an application module integration test bootstrap
[source, text, subs="macros"]
----
. ____ _ __ _ _