### Question:
CommitController extends AbstractRepositoryController { @PostMapping("/repos/{owner}/{repoName}/unstage-changes") public ResponseEntity<Map<String, Object>> unstageChanges( Principal principal, @PathVariable("owner") String owner, @PathVariable("repoName") String repoName, @RequestBody String[] param) { if(principal == null) { throw new NoAuthorizationException(); } Repository repository = repositoryService.find(owner, repoName).orElseThrow(ResourceNotFoundException::new); repositoryPermissionService.canWrite(principal, repository).orElseThrow(NoAuthorizationException::new); repositoryResourceService.unstageChanges(repository, param); return ResponseEntity.ok(Collections.emptyMap()); }  @GetMapping("/repos/{owner}/{repoName}/changes") ResponseEntity<List<UncommittedFile>> listChanges(
			Principal principal,
			@PathVariable("owner") String owner,
			@PathVariable("repoName") String repoName); @PostMapping("/repos/{owner}/{repoName}/stage-changes") ResponseEntity<Map<String, Object>> stageChanges(
			Principal principal,
			@PathVariable("owner") String owner,
			@PathVariable("repoName") String repoName,
			@RequestBody String[] param); @PostMapping("/repos/{owner}/{repoName}/unstage-changes") ResponseEntity<Map<String, Object>> unstageChanges(
			Principal principal,
			@PathVariable("owner") String owner,
			@PathVariable("repoName") String repoName,
			@RequestBody String[] param); @PostMapping("/repos/{owner}/{repoName}/commits") ResponseEntity<Map<String, Object>> commit(
			Principal principal,
			@PathVariable("owner") String owner,
			@PathVariable("repoName") String repoName,
			@Valid @RequestBody CommitMessage param,
			BindingResult bindingResult);  }### Answer:
@WithMockUser(username = "jack") @Test public void unstageChangesSuccess() { Repository repository = new Repository(); repository.setId(1); when(repositoryService.find(anyString(), anyString())).thenReturn(Optional.of(repository)); when(repositoryPermissionService.canWrite(any(), any())).thenReturn(Optional.of(AccessLevel.WRITE)); String[] param = new String[] {}; given() .contentType(ContentType.JSON) .body(param) .when() .post("/repos/{owner}/{repoName}/unstage-changes", "jack", "repo") .then() .statusCode(HttpStatus.SC_OK); verify(repositoryResourceService).unstageChanges(any(), any()); }