-
Changes in Version 3.6.2 (2021-01-22)
Changes in Version 3.5.0 (2020-06-04)
Changes in Version 3.4.2 (2020-03-26)
Changes in Version 3.3.1 (2019-08-22)
Changes in Version 3.3.0 (2019-01-09)
Changes in Version 3.2.1 (2018-12-21)
Changes in Version 3.2.0 (2018-08-27)
Changes in Version 3.1.1 (2018-06-29)
Changes in Version 3.1.0 (2018-03-27)
Changes in Version 3.0.0 (2018-02-20)
Modules
tapir distinguishes between Inclusion modules and Bootstrap modules. In contrast to Inclusion modules, Bootstrap modules are executable and there can only be one Bootstrap module in your execution classpath.
Spring Boot
tapir relies on Spring Boot and its auto-configuration capabilities. tapir attempts to automatically configure your Test execution based on the jar dependencies that you have added. The AutoConfiguration just collects all available configurations at runtime and weaves them together. The main entry point in tapir’s context is the class which is annotated by @BootstrapConfiguration.
Bootstrap Module
A Bootstrap module has to contain a class which is annotated by @BootstrapConfiguration. This class is the main entry point for the configuration of your test execution environment. You do not have to add anything in this class, unless you would like to customize or extend tapir. These possibilities are convered in the chapter Customiziation.
Beside a Bootstrap Configuration you need a class annotated by @TestClass which contains at least one method which is annotated by @Step. So the most simple setup to run a tapir test looks like this:
import de.bmiag.tapir.bootstrap.annotation.BootstrapConfiguration
@BootstrapConfiguration
class MyConfiguration {
}
You also need to include the bootstrap module as dependency.
<dependency>
<groupId>de.bmiag.tapir</groupId>
<artifactId>tapir-bootstrap</artifactId>
</dependency>
import de.bmiag.tapir.execution.annotations.step.Step
import de.bmiag.tapir.execution.annotations.testclass.TestClass
@TestClass
class MyTest {
@Step
def void step1() {
println("step1 has been executed!")
}
}
The easisiest way to create a bootstrap module is the corresponding archetype.
Inclusion Module
These modules cannot be executed, but provide some functionality which might (directly or transitively) be used by a Bootstrap module. Like Bootstrap modules, Inclusion modules have a main configuration class as well which is annotated by @ModuleConfiguration.
The @ModuleConfiguration is contained in the bootstrap module.
<dependency>
<groupId>de.bmiag.tapir</groupId>
<artifactId>tapir-bootstrap</artifactId>
</dependency>
You don’t need to have any further configuration as BootstrapConfiguration and ModuleConfiguration are aware of Spring’s component-scan capabilities.
The easiest way to create an inclusion module is the corresponding archetype.
- Previous
- Next