Skip to content

Examples of Junit 5 Test on Dynamic test & Spring Boot etc. </br> 使用Junit 5 进行单元测试的各种用例

License

Notifications You must be signed in to change notification settings

bluetata/java-maven-junit5-example

Repository files navigation

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

About

Examples of Junit 5 Test on Dynamic test & Spring Boot etc. </br> 使用Junit 5 进行单元测试的各种用例

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages