A „Hello World!” sample written in Java that showcases very simple unit and integration tests.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 11 commits ahead of LableOrg:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
Jenkinsfile
LICENSE
README.md
pom.xml

README.md

A Java/Maven/JUnit HelloWorld example

A „Hello World!” sample written in Java using Maven for the build, that showcases a few very simple tests.

This example demonstrates:

  • A simple Java 8 application with tests
  • Unit tests written with JUnit 5
  • Integration tests written with JUnit 5
  • Code coverage reports via JaCoCo
  • A Maven build that puts it all together

Running the tests

  • To run the unit tests, call mvn test
  • To run the integration tests as well, call mvn verify
  • Code coverage reports are generated when mvn verify (or a full mvn clean install) is called. Point a browser at the output in target/site/jacoco-both/index.html to see the report.

Conventions

This example follows the following basic conventions:

unit test integration test
resides in: src/test/java/*Test.java src/test/java/*IT.java
executes in Maven phase: test verify
handled by Maven plugin: surefire failsafe