springspring-bootspring-boot-testspring-boot-gradle-plugin

Spring boot application is not picking all the test cases for execution after migrating spring boot 2.5.12


We have spring-boot application ,when we try to run unit tests it seems that some of the unit tests cases are not picking for execution. This issue started happening after upgrading spring boot version from 2.3.9 to 2.5.12 We are using java 11,gradle 6.8 and gradle dependency testCompile 'junit:junit:4.12'

Any reason of not picking all the test cases for execution?


Solution

  • Check the Spring Boot 2.4 release notes regarding JUnit 5:

    If you do not want to migrate your tests to JUnit 5 and wish to continue using JUnit 4, add a dependency on the Vintage Engine

    https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.4-Release-Notes#junit-5s-vintage-engine-removed-from-spring-boot-starter-test