How to use Junit 4 in a Spring Boot 2.6 project
Downgrade spring-boot-starter-test to use Junit 4 instead of 5
2 min readFeb 12, 2022
As you know, from Spring Boot 2.2
when you add the spring-boot-starter-test
dependency to your Spring Boot project, your project will be configured to use JUnit 5
. It does not make sense to downgrade the JUnit version to 4 when you start a Spring Boot project from scratch with…