С Spring boot 1.5.9 и последующими версиями:
@RunWith(SpringRunner.class)
@AutoConfigureMockMvc
@SpringBootTest
public class BigPoolControllerMockMvcTest {
@Autowired
private MockMvc mockMvc;
@Before
public void initialize() {
}
@Test
public void testGetDisplayPools() throws Exception {
this.mockMvc.perform(get(CONTROLLER_PATH + DISPLAY_POOLS_API + "?param=abc")
.contentType(MediaType.APPLICATION_JSON_UTF8))
.andDo(print()).andExpect(status().isOk());
}
}
Я продолжаю получать: WARN o.s.web.servlet.PageNotFound - не найдено сопоставление для HTTP-запроса с URI [api/v1/app/pool] в DispatcherServlet с именем ''