### Question:
BasicController { @GetMapping("/welcome-with-object") public WelcomeBean welcomeWithObject() { return new WelcomeBean("Hello World"); }  @GetMapping("/welcome") String welcome(); @GetMapping("/welcome-with-object") WelcomeBean welcomeWithObject(); @GetMapping("/welcome-with-parameter/name/{name}") WelcomeBean welcomeWithParameter(@PathVariable String name);  }### Answer:
@Test public void welcomeWithObject() throws Exception { mvc.perform(MockMvcRequestBuilders.get("/welcome-with-object").accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()).andExpect(content().string(containsString("Hello World"))); }