### Question:
TagController { @GetMapping("/tag/id/{id}") public Response retrieveOneById(@PathVariable("id") long id) { return ResponseUtil.success(tagService.retrieveOneById(id)); }  @PostMapping("/admin/tag/create") Response addOne(@RequestParam("name") String name); @DeleteMapping("/admin/tag/del") Response delOne(@RequestParam("id") long id); @PutMapping("/admin/tag/update") Response updateOne(@RequestParam("id") Long id, @RequestParam("name") String name); @GetMapping("/tag/id/{id}") Response retrieveOneById(@PathVariable("id") long id); @GetMapping("/tag/name/{name}") Response retrieveOneByName(@PathVariable("name") String name); @GetMapping("/tags") Response getPage(@RequestParam(required = false, defaultValue = "10", value = "count") int count,
                            @RequestParam(required = false, defaultValue = "1", value = "page") int page); @GetMapping("/tags/nac") Response getTagNameAndCount();  }### Answer:
@Test public void retrieveOneById() throws Exception { Tag tag = tagMapper.getLastestTag(); assertNotNull(tag.getId()); mockMvc.perform(get("/tag/id/" + tag.getId())).andDo(result -> { JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString()); assertEquals(SUCCESS.getCode(), object.getInt(Code)); assertNotNull(object.getJSONObject(Result)); Tag t = (Tag) JSONObject.toBean(object.getJSONObject(Result), Tag.class); assertEquals(tag.getId(), t.getId()); assertNotNull(t.getName()); }); }