Рет қаралды 4,343
A hands-on example of using Mockito in a BDD/TDD unit test. We start by looking at a Given When Then example of saving an object. We translate that into a series of test methods. As we complete the test methods, we see additions we need to make to our service layer, and a new DAO and DAO layer that we need to make. We mock this DAO with Mockito, and then use the mocked DAO in the service class. We verify that our tests work against this mocked class. Next, we demonstrate how to validate that a method is invoked with Mockito's verify() method.
Source code is freely available on GitHub: github.com/dis...
This video is part of a playlist on Microservices and Spring Boot with IntelliJ IDEA: • IntelliJ IDEA, Git, Gi...