@Test public void testHelloWorldController() throws Exception { MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get("/")) .andExpect(request().asyncStarted()) .andDo(MockMvcResultHandlers.print()) .andReturn(); mockMvc.perform(asyncDispatch(mvcResult)) .andExpect(status().isOk()) .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN)) .andExpect(content().string("Hello World, from Spring Boot 2!")); }
public HelloWorldController(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; }
HelloWorldController { public HelloWorldController(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } }
HelloWorldController { public HelloWorldController(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } HelloWorldController(TaskExecutor taskExecutor); }
HelloWorldController { public HelloWorldController(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } HelloWorldController(TaskExecutor taskExecutor); @GetMapping CompletableFuture<String> hello(); }
HelloWorldController { public HelloWorldController(TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } HelloWorldController(TaskExecutor taskExecutor); @GetMapping CompletableFuture<String> hello();  }