@Test void getMessage() throws Exception { MockHttpServletResponse response1 = mockMvc.perform(get("/message")) .andReturn().getResponse(); MockHttpServletResponse response2 = mockMvc.perform(get("/message")) .andReturn().getResponse(); assertThat(response1.equals(to(response2))); }
@GetMapping("message") public String getMessage() { return "Hello from RequestScopeController"; }
RequestScopeController { @GetMapping("message") public String getMessage() { return "Hello from RequestScopeController"; } }
RequestScopeController { @GetMapping("message") public String getMessage() { return "Hello from RequestScopeController"; }  }
RequestScopeController { @GetMapping("message") public String getMessage() { return "Hello from RequestScopeController"; }  @GetMapping("message") String getMessage(); }
RequestScopeController { @GetMapping("message") public String getMessage() { return "Hello from RequestScopeController"; }  @GetMapping("message") String getMessage();  }