what's the difference between spring-boot-test vs spring-boot-starter-test?

The spring-boot-starter-test is an aggregated "starter pack" for libraries using often together for testing in Spring applications.

As stated in the latest version reference documentation, the spring-boot-starter-test contains:

  • JUnit 5 (including the vintage engine for backward compatibility with JUnit 4)

  • Spring Test & Spring Boot Test - This is the spring-boot-test dependency)

  • AssertJ, Hamcrest, Mockito, JSONassert, and JsonPath.


From Spring Boot official reference:

Spring Boot provides a number of utilities and annotations to help when testing your application. Test support is provided by two modules: spring-boot-test contains core items, and spring-boot-test-autoconfigure supports auto-configuration for tests.

more details>>


Please have a look at the maven definitions. The contents of the packages are detailed there. spring-boot-starter-test seems to be a superset of spring-boot-test since spring-boot-starter-test has dependency for spring-boot-test.

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test/2.2.5.RELEASE

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-test/2.2.5.RELEASE