### Question:
ConfigController { @CrossOrigin(origins = "*") @PutMapping(value = "/configs") public HttpEntity updateConfig(@RequestBody Config info, @RequestHeader HttpHeaders headers) { return ok(configService.update(info, headers)); }  @GetMapping(path = "/welcome") String home(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(value = "/configs") HttpEntity queryAll(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(value = "/configs") HttpEntity<?> createConfig(@RequestBody Config info, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PutMapping(value = "/configs") HttpEntity updateConfig(@RequestBody Config info, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @DeleteMapping(value = "/configs/{configName}") HttpEntity deleteConfig(@PathVariable String configName, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(value = "/configs/{configName}") HttpEntity retrieve(@PathVariable String configName, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testUpdateConfig() throws Exception { Config info = new Config(); Mockito.when(configService.update(Mockito.any(Config.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(info); String result = mockMvc.perform(MockMvcRequestBuilders.put("/api/v1/configservice/configs").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }