import static org.junit.Assert.*;import static org.springframework.test.web.client.match.      MockRestRequestMatchers.method;import static org.springframework.test.web.client.match.      MockRestRequestMatchers.requestTo;import static org.springframework.test.web.client.ExpectedCount.once;import static org.springframework.test.web.client.response.      MockRestResponseCreators.withSuccess;...@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(classes  =  {WebConfig.class,      StandaloneRestUserControllerTest.TestConfig.class})@WebAppConfigurationpublic class StandaloneRestUserControllerTest {
    @Configuration    static class TestConfig {        @Bean        UserService userService() {            return Mockito.mock(UserService.class); ...

Get Pivotal Certified Professional Spring Developer Exam: A Study Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.