Clone this repo:

Branches

  1. 5cc7aab Delete Jenkinsfile by Ajayvarma8142 · 3 years, 8 months ago master
  2. b914d7f Delete jenkinsfile by Ajayvarma8142 · 3 years, 8 months ago
  3. 42196a1 Added Jenkinsfile by Ajayvarma8142 · 3 years, 8 months ago
  4. 7e6f3fb Create jenkinsfile by Ajayvarma8142 · 3 years, 8 months ago
  5. 6c7fc18 Create sonar-scanner by Ajayvarma8142 · 3 years, 9 months ago

java-junit-sample

This project is meant to show the usage of JUnit, Mockito and Powermock for unit testing in Java. To be able to show some "real" examples a kind of dummy application is provided here to have some usecases for the different tests. The dummy application does really nothing, but it has some of the patterns we might encounter in testing like usage of a repository and some static methods from some tool-like classes. Not that this might not be the best design, but I think we often see this in real life. If not, even better and probably easier for unit testing.

Ther eis also a corresponding blog article to this repository that can be found from here and explains in more detail the approaches shown here: https://blog.codecentric.de/en/2016/03/junit-testing-using-mockito-powermock/