### Question:
LinksController { @GetMapping("/admin/links") public Response all(@RequestParam("page") int page, @RequestParam("count") int count) { return ResponseUtil.success(partnerSiteService.PartnerSitePages(page, count)); }  @PostMapping("/admin/links/create") Response create(@RequestBody LinkReq reqBody); @DeleteMapping("/admin/links/del/{id}") Response del(@PathVariable("id") long id); @PutMapping("/admin/links/update") Response update(@RequestBody LinkReq reqBody); @GetMapping("/links") Response allForOpen(); @GetMapping("/admin/links") Response all(@RequestParam("page") int page,
                        @RequestParam("count") int count); @PostMapping("/apply") Response apply(@RequestParam("name") String name,
                          @RequestParam("url") String url);  }### Answer:
@Test public void all() throws Exception { mockMvc.perform(get("/admin/links?page=1&count=10").header("Authorization", adminLogin())).andDo(result -> { JSONObject object = JSONObject.fromObject(result.getResponse().getContentAsString()); assertEquals(SUCCESS.getCode(), object.getInt(Code)); PageInfo pageInfo = (PageInfo) JSONObject.toBean(object.getJSONObject(Result), PageInfo.class); assertNotEquals(0, pageInfo.getStartRow()); assertNotEquals(0, pageInfo.getEndRow()); assertEquals(1, pageInfo.getPageNum()); assertEquals(10, pageInfo.getPageSize()); pageInfo.getList().forEach(o -> { PartnerSite site = (PartnerSite) JSONObject.toBean(JSONObject.fromObject(o), PartnerSite.class); assertNotNull(site.getUrl()); assertNotNull(site.getName()); assertNotNull(site.getOpen()); }); }); }