A „Hello World!” sample written in Java using Maven for the build, that showcases a few very simple tests.
This example demonstrates:
- A simple calculator application with tests
- Unit tests written with JUnit 5
- A Maven build that puts it all together
- To run the unit tests, call
mvn test
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 |