Testing Framework for Maven Plugin Mojo for Junit 5

Junit 5 test for maven plugin project using.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

io.github.devbhuwan
ArtifactId

ArtifactId

maven-plugin-test-jupiter
Last Version

Last Version

1.0.3.RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

Testing Framework for Maven Plugin Mojo for Junit 5
Junit 5 test for maven plugin project using.
Project URL

Project URL

https://github.com/devbhuwan/maven-plugin-test-jupiter
Project Organization

Project Organization

Bhuwan Prasad Upadhyay
Source Code Management

Source Code Management

https://github.com/devbhuwan/maven-plugin-test-jupiter/

Download maven-plugin-test-jupiter

How to add to project

<!-- https://jarcasting.com/artifacts/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>
// https://jarcasting.com/artifacts/io.github.devbhuwan/maven-plugin-test-jupiter/
implementation 'io.github.devbhuwan:maven-plugin-test-jupiter:1.0.3.RELEASE'
// https://jarcasting.com/artifacts/io.github.devbhuwan/maven-plugin-test-jupiter/
implementation ("io.github.devbhuwan:maven-plugin-test-jupiter:1.0.3.RELEASE")
'io.github.devbhuwan:maven-plugin-test-jupiter:jar:1.0.3.RELEASE'
<dependency org="io.github.devbhuwan" name="maven-plugin-test-jupiter" rev="1.0.3.RELEASE">
  <artifact name="maven-plugin-test-jupiter" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.devbhuwan', module='maven-plugin-test-jupiter', version='1.0.3.RELEASE')
)
libraryDependencies += "io.github.devbhuwan" % "maven-plugin-test-jupiter" % "1.0.3.RELEASE"
[io.github.devbhuwan/maven-plugin-test-jupiter "1.0.3.RELEASE"]

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.commons : commons-exec jar 1.3
org.codehaus.plexus : plexus-classworlds jar 2.5.2
org.apache.commons : commons-lang3 jar 3.7
io.takari.maven.plugins : takari-plugin-testing jar 2.9.2

provided (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.1.0
org.projectlombok : lombok jar 1.16.20

Project Modules

There are no modules declared in this project.

maven-plugin-test-jupiter

Travis branch Codecov

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();
    }
 
}

Versions

Version
1.0.3.RELEASE
1.0.2.RELEASE
1.0.1.RELEASE
1.0.0.RELEASE