### Question:
PageDesignerController extends AbstractRepositoryController { @GetMapping("/designer/pages/{pageId}/model") public ResponseEntity<PageModel> getPageModel( Principal principal, @PathVariable Integer pageId) { RepositoryResource page = repositoryResourceService.findById(pageId).orElseThrow(ResourceNotFoundException::new); if(!page.isPage()) { throw new ResourceNotFoundException(); } Repository repository = repositoryService.findById(page.getRepositoryId()).orElseThrow(ResourceNotFoundException::new); repositoryPermissionService.canRead(principal, repository).orElseThrow(NoAuthorizationException::new); PageModel result = repositoryResourceService.getPageModel(page); return ResponseEntity.ok(result); }  @GetMapping("/designer/projects/{projectId}/dependencies") ResponseEntity<List<Dependence>> listProjectDependencies(
			Principal principal,
			@PathVariable Integer projectId, // 此处的 projectId 就是仓库中的分组 id
			@RequestParam String repo); @GetMapping("/designer/projects/{projectId}/dependencies/widgets") ResponseEntity<List<RepoWidgetList>> getProjectDependenciesWidgets(
			Principal principal,
			@PathVariable Integer projectId); @GetMapping("/designer/pages/{pageId}/model") ResponseEntity<PageModel> getPageModel(
			Principal principal, 
			@PathVariable Integer pageId); @PutMapping("/designer/pages/{pageId}/model") ResponseEntity<Map<String, Object>> updatePageModel(
			Principal principal, 
			@PathVariable Integer pageId, 
			@RequestBody PageModel model ); @GetMapping("/designer/assets/{gitRepoWebsite}/{gitRepoOwner}/{gitRepoName}/{version}/{fileName}") ResponseEntity<InputStreamSource> getAsset(
			@PathVariable String gitRepoWebsite,
			@PathVariable String gitRepoOwner,
			@PathVariable String gitRepoName,
			@PathVariable String version,
			@PathVariable String fileName);  }### Answer:
@Test public void get_page_model_login_user_can_access_public_project() { UserInfo user = new UserInfo(); user.setId(1); when(userService.findByLoginName(anyString())).thenReturn(Optional.of(user)); RepositoryResource page = new RepositoryResource(); page.setId(1); page.setRepositoryId(1); page.setResourceType(RepositoryResourceType.PAGE); when(repositoryResourceService.findById(anyInt())).thenReturn(Optional.of(page)); Repository project = new Repository(); project.setId(1); project.setIsPublic(true); when(repositoryService.findById(anyInt())).thenReturn(Optional.of(project)); when(repositoryPermissionService.canRead(any(), any())).thenReturn(Optional.of(AccessLevel.READ)); when(repositoryResourceService.getPageModel(any())).thenReturn(new PageModel()); given() .contentType(ContentType.JSON) .when() .get("/designer/pages/{pageId}/model", "1") .then() .statusCode(HttpStatus.SC_OK) .body("data.size()", is(0), "widgets.size()", is(0), "functions.size()", is(0)); }