Read this in other languages:中文.
This repository contains some examples of JUnit 5
- Junit 5 Basic Test (done)
- Junit 5 Dynamic Test (done)
- Junit 5 Assertions Test (done)
- Junit 5 Assumptions Test (done)
- Junit 5 Nested Test (done)
- Junit 5 Ignore/Disable parts of Test Case (done)
- Junit 5 Exception Control Test (doing...)
- Junit 5 Spring Boot Test Sample (done)
- Jenkins + Maven integrate Junit 5 + TestNG to Test Automation (doing...)
NOTE: You could choose clone this repo., alternatively you could use the Download Zip button to down code zip file to local.
Clone the java-maven-junit5-example
locally. In a terminal, run:
$ git clone https://github.com/bluetata/java-maven-junit5-example.git
Menu File –> New –> Project from Exist Sources... –> Existing Maven Projects
Browse and select pom.xml in your source code location
Then click Next -> Next -> Next -> Finish button to finish the importing.
Menu File –> Import –> Maven –> Existing Maven Projects,
Browse to your source code location,
Click Finish button to finish the importing.
In a terminal, run:
$ mvn test
You can also run the test in IntelliJ IDEA: Right click in run test class and click run 'XxxXxxTest' with Coverage button.
As the repo using maven-surefire-report-plugin plug, you can find the test report in scr/target/surefire-reports folder.
Spring Running
Test Result
Coverage
Test Result Report