Skip to content

venkatvirat/Maven-Java-Project

 
 

Repository files navigation

Java-Maven-Junit-HelloWorld

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

This example demonstrates:

  • Unit tests written with JUnit 4
  • Unit test using PowerMockito to mock classes and test System.exit()
  • Integration tests written with JUnit 4
  • Integration test using system-rules to test System.out
  • Code coverage reports via Soanr.
  • 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
  • To generate (unit test) code coverage reports, call mvn sonar:sonar

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

About

Maven-Java-Project

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jinja 45.2%
  • Java 43.6%
  • Shell 7.3%
  • Dockerfile 2.4%
  • Python 1.5%