maven-plugin-test-jupiter
How to use
- Maven Dependency
<!-- https://mvnrepository.com/artifact/io.github.devbhuwan/maven-plugin-test-jupiter -->
<dependency>
<groupId>io.github.devbhuwan</groupId>
<artifactId>maven-plugin-test-jupiter</artifactId>
<version>1.0.3.RELEASE</version>
</dependency>
- Using
@EmbeddedMojoJunitConfig
Example
@EmbeddedMojoJunitConfig
class EmbeddedMojoJUnitConfigUnitTests {
@MojoTest
void definedCorrectPropertyValuesWithMojoThenBuildSuccessful(PluginMojo mojo) throws Exception {
mojo.begin()
.execute("your-plugin-goal").assertErrorFreeLog();
}
@MojoTest
void buildSuccessUsingClassLevelMojo(PluginMojo mojo) throws Exception {
mojo.begin().execute("your-plugin-goal").assertErrorFreeLog();
}
}
- Using
@MojoJunitConfig
@MojoJunitConfig
class MojoJUnitConfigUnitTests {
@MojoTest(project = "src/projects/mojo-junit")
void definedCorrectPropertyValuesWithMojoThenBuildSuccessful(PluginMojo mojo) throws Exception {
mojo.begin()
.execute("your-plugin-goal").assertErrorFreeLog();
}
@MojoTest(project = "src/projects/mojo-junit-2")
void buildSuccessUsingClassLevelMojo(PluginMojo mojo) throws Exception {
mojo.begin().execute("verify").assertErrorFreeLog();
}
}