January 2018
Intermediate to advanced
414 pages
10h 29m
English
Using Mockito allows us to verify the invocation of our mock. We can use it to validate that our controller actually invoked the method of the service, and also know with which parameter it's used.
First, we will verify our customer list test:
package com.microservices.chapter09import org.junit.Testimport org.junit.runner.RunWithimport org.mockito.BDDMockito.givenimport org.mockito.BDDMockito.thenimport org.mockito.Mockito.resetimport org.mockito.Mockito.timesimport org.springframework.beans.factory.annotation.Autowiredimport org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvcimport org.springframework.boot.test.context.SpringBootTestimport org.springframework.boot.test.mock.mockito.MockBean ...
Read now
Unlock full access