January 2018
Intermediate to advanced
414 pages
10h 29m
English
Now that we have our CustomerService mocked, we can define what value should be returned for our test.
We will modify the test to get a list of customers:
package com.microservices.chapter09import org.junit.Testimport org.junit.runner.RunWithimport org.mockito.BDDMockito.givenimport org.mockito.Mockito.resetimport 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.MockBeanimport org.springframework.test.context.junit4.SpringRunnerimport org.springframework.test.web.servlet.MockMvcimport org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get ...
Read now
Unlock full access