### Question:
AppController { @GetMapping("/search") @ApiOperation("查询项目") public Result<PageData<App>> searchByAppCodeOrAppName(@RequestParam(required = false) String query, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int size) { Pageable pageable = PageRequest.of(page - 1, size); if (StringUtils.isEmpty(query)) { return ok(appService.findAllWithAuthorize(pageable)); } else { return ok(appService.searchByAppCodeOrAppName(query, pageable)); } }  @PostMapping @ApiOperation("创建项目") @AppPreAuthorize(AppPreAuthorize.Authorize.SuperAdmin) Result<App> create(@Valid @RequestBody AppModel appModel); @GetMapping("/search") @ApiOperation("查询项目") Result<PageData<App>> searchByAppCodeOrAppName(@RequestParam(required = false) String query, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "20") int size); @GetMapping @ApiOperation("查询所有的项目") Result<List<App>> getAllAppWithAuthorize(); @GetMapping("/{appId:\\d+}") @ApiOperation("查询项目信息") Result<App> getApp(@PathVariable Long appId); @PutMapping("/{appId:\\d+}") @ApiOperation("修改项目信息") @AppPreAuthorize(AppPreAuthorize.Authorize.AppOwner) Result<App> update(@PathVariable Long appId, @Valid @RequestBody AppModel appModel); @GetMapping("/code/{appCode:[0-9a-zA-Z_.-]+}") @ApiOperation("查询项目信息") Result<App> getAppByCode(@PathVariable String appCode); @ApiOperation("项目菜单") @GetMapping("/{appId:\\d+}/navtree") Result<List<EnvClusterInfo>> nav(@PathVariable long appId);  }### Answer:
@Test public void searchByAppCodeOrAppName() { Result<PageData<App>> pageDataResult = appController.searchByAppCodeOrAppName("apollo", 1, 10); Assert.assertTrue(pageDataResult.success()); }