Unit Testing Using Spring Boot
Learn how to write a test using the @SpringBootTest annotation and why it should not be used for unit testing.
We'll cover the following...
When we create an application using Spring Boot, we get the springboot-starter-test
dependency that comes with Mockito and AssertJ as testing libraries. We also automatically get a test file with the @SpringBootTest
annotation.
Unit testing should not be done using Spring Boot. The main purpose of unit testing is to test a method or class. However, @SpringBootTest
loads the entire context, which makes the test lengthy and defeats the purpose of unit testing. This feature of Spring Boot should ...
Access this course and 1400+ top-rated courses and projects.