### Question:
PaymentController { @GetMapping(path = "/payment") public HttpEntity query(@RequestHeader HttpHeaders headers) { return ok(service.query(headers)); }  @GetMapping(path = "/welcome") String home(); @PostMapping(path = "/payment") HttpEntity pay(@RequestBody Payment info, @RequestHeader HttpHeaders headers); @PostMapping(path = "/payment/money") HttpEntity addMoney(@RequestBody Payment info, @RequestHeader HttpHeaders headers); @GetMapping(path = "/payment") HttpEntity query(@RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testQuery() throws Exception { Mockito.when(service.query(Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/paymentservice/payment")) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }