DEV Community

How to enable JUnit 5 in new Spring Boot project

Martin Belev on February 03, 2019

This post was originally posted on Medium. In this article, we will learn how to enable JUnit 5 in a newly created Spring Boot project. We are goi...
Collapse
 
doribd profile image
Dor Ben Dov

great thanks, very simple configuration

Collapse
 
ovidiu141 profile image
Ovidiu Miu • Edited

spring-boot-starter-test >2.2.0 comes with Junit 5, so no need for this if you use the most recent version of Spring Boot (or of spring-boot-starter-web).

Collapse
 
faisal6621 profile image
Mohammad Faisal • Edited

For my application using spring-boot version 2.1.9.RELEASE adding maven-surefire-plugin was not needed. Also, the junit-jupiter-api and junit-jupiter-engine dependencies have the managed version 5.3.2 already. But I could not figure this out that if spring-boot-starter-test is using JUnit-4 then where does this managed version of JUnit-5 is coming from?