### Question:
RefactoringScriptService implements ScriptService { public Job move(MoveRequest request) { return execute(RefactoringJobs.MOVE, request); }  RequestFactory getRequestFactory(); Job move(MoveRequest request); Job move(Collection<EntityReference> sources, EntityReference destination); Job move(EntityReference source, EntityReference destination); Job rename(MoveRequest request); Job rename(EntityReference oldReference, EntityReference newReference); Job rename(EntityReference reference, String newName); Job convertToNestedDocument(DocumentReference documentReference); Job convertToTerminalDocument(DocumentReference documentReference); Job copy(CopyRequest request); Job copy(Collection<EntityReference> sources, EntityReference destination); Job copy(EntityReference source, EntityReference destination); Job copyAs(CopyRequest request); Job copyAs(EntityReference sourceReference, EntityReference copyReference); Job copyAs(EntityReference reference, String copyName); Job delete(EntityRequest request); Job delete(Collection<EntityReference> entityReferences); Job delete(EntityReference entityReference); Job create(CreateRequest request); Job create(Collection<EntityReference> entityReferences); Job create(EntityReference entityReference); Exception getLastError(); Job restore(RestoreRequest restoreRequest); Job restore(String batchId); Job restore(List<Long> deletedDocumentIds); Job permanentlyDelete(PermanentlyDeleteRequest request); Job permanentlyDelete(String batchId); Job permanentlyDelete(List<Long> deletedDocumentIds); @Unstable Job changeDocumentAuthor(DocumentReference oldAuthorReference, DocumentReference newAuthorReference); @Unstable Job replaceUser(ReplaceUserRequest request); @Unstable boolean isRecycleBinSkippingAllowed();  }### Answer:
@Test void move() throws Exception { SpaceReference source = new SpaceReference("Space", new WikiReference("math")); WikiReference destination = new WikiReference("code"); MoveRequest moveRequest = new MoveRequest(); this.fillCopyOrMoveRequest(moveRequest); when(this.requestFactory.createMoveRequest(source, destination)).thenReturn(moveRequest); this.refactoringScriptService.move(source, destination); verify(this.requestFactory).createMoveRequest(source, destination); verify(this.jobExecutor).execute(RefactoringJobs.MOVE, moveRequest); }
@Test void moveWithoutPR() { MoveRequest request = new MoveRequest(); request.setCheckRights(false); request.setUserReference(new DocumentReference("wiki", "Users", "Bob")); DocumentReference authorReference = mock(DocumentReference.class); DocumentReference userReference = mock(DocumentReference.class); when(this.documentAccessBridge.getCurrentAuthorReference()).thenReturn(authorReference); when(this.documentAccessBridge.getCurrentUserReference()).thenReturn(userReference); this.refactoringScriptService.move(request); assertTrue(request.isCheckRights()); assertSame(userReference, request.getUserReference()); assertSame(authorReference, request.getAuthorReference()); }
@Test void moveWithPR() { MoveRequest request = new MoveRequest(); request.setCheckRights(false); DocumentReference bobReference = new DocumentReference("wiki", "Users", "Bob"); request.setUserReference(bobReference); when(authorization.hasAccess(Right.PROGRAM)).thenReturn(true); this.refactoringScriptService.move(request); assertFalse(request.isCheckRights()); assertEquals(bobReference, request.getUserReference()); }