From the course: Extending, Securing, and Dockerizing Spring Boot Microservices

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Unit testing with Mockito vs. integration testing

Unit testing with Mockito vs. integration testing

From the course: Extending, Securing, and Dockerizing Spring Boot Microservices

Start my 1-month free trial

Unit testing with Mockito vs. integration testing

- (Narrator) Frequent feedback I receive from learners about creating your first Spring Boot RESTful Microservice, was that it lacked Unit tests, I couldn't agree more. The goal of this course was to introduce several Spring frameworks, not to test them. However, it was difficult to shake that developer shame. Because I truly believe that, "Code isn't code unless it has code to test the code." So it is with great satisfaction, and sense of redemption that I present TESTS. I'm assuming you already know how to create and configure JUnit tests with Spring, but if not I suggest you check out Shana Smith's " Spring: Test-Driven Development with Junit" in the learning library. A Unit test will test a class in isolation, meaning to test only the code in the class, not its dependencies An integration test will invoke not just the class, but also its underlying dependencies. In the exercise files of this chapter, there are several Unit tests, but I want to focus on testing Tour Rating Service…

Contents