Skip to content

Latest commit

 

History

History
111 lines (55 loc) · 2.7 KB

README.md

File metadata and controls

111 lines (55 loc) · 2.7 KB

java-maven-junit5-example

Read this in other languages:中文.

Introduction

This repository contains some examples of JUnit 5

Sample Code Component contains

Test Steps

NOTE: You could choose clone this repo., alternatively you could use the Download Zip button to down code zip file to local.

  1. Clone the repo

  2. Run the Junit 5 Test

  3. Test Result Report

1. Clone the repo

Clone the java-maven-junit5-example locally. In a terminal, run:

$ git clone https://github.com/bluetata/java-maven-junit5-example.git

Import source code locally(if you don't usedclonecommand)

  • 1. IntelliJ IDEA

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.

  • 2. Eclipse

Menu File –> Import –> Maven –> Existing Maven Projects,

Browse to your source code location,

Click Finish button to finish the importing.

2. Run the Junit 5 Test

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.

3. Test Result Report

As the repo using maven-surefire-report-plugin plug, you can find the test report in scr/target/surefire-reports folder.

Sample output

Spring Running

Test Result

Coverage

Test Result Report

License

Apache 2.0