@Test void changeDocumentAuthor() throws Exception { DocumentReference alice = new DocumentReference("dev", "Users", "Alice"); DocumentReference bob = new DocumentReference("test", "Users", "Bob"); ReplaceUserRequest request = mock(ReplaceUserRequest.class); when(this.requestFactory.createReplaceUserRequest(alice, bob)).thenReturn(request); Job job = mock(Job.class); when(this.jobExecutor.execute(RefactoringJobs.REPLACE_USER, request)).thenReturn(job); assertSame(job, this.refactoringScriptService.changeDocumentAuthor(alice, bob)); verify(request).setReplaceDocumentAuthor(true); verify(request).setReplaceDocumentContentAuthor(true); }
@Unstable public Job changeDocumentAuthor(DocumentReference oldAuthorReference, DocumentReference newAuthorReference) { ReplaceUserRequest request = getRequestFactory().createReplaceUserRequest(oldAuthorReference, newAuthorReference); request.setReplaceDocumentAuthor(true); request.setReplaceDocumentContentAuthor(true); return this.replaceUser(request); }
RefactoringScriptService implements ScriptService { @Unstable public Job changeDocumentAuthor(DocumentReference oldAuthorReference, DocumentReference newAuthorReference) { ReplaceUserRequest request = getRequestFactory().createReplaceUserRequest(oldAuthorReference, newAuthorReference); request.setReplaceDocumentAuthor(true); request.setReplaceDocumentContentAuthor(true); return this.replaceUser(request); } }
RefactoringScriptService implements ScriptService { @Unstable public Job changeDocumentAuthor(DocumentReference oldAuthorReference, DocumentReference newAuthorReference) { ReplaceUserRequest request = getRequestFactory().createReplaceUserRequest(oldAuthorReference, newAuthorReference); request.setReplaceDocumentAuthor(true); request.setReplaceDocumentContentAuthor(true); return this.replaceUser(request); }  }
RefactoringScriptService implements ScriptService { @Unstable public Job changeDocumentAuthor(DocumentReference oldAuthorReference, DocumentReference newAuthorReference) { ReplaceUserRequest request = getRequestFactory().createReplaceUserRequest(oldAuthorReference, newAuthorReference); request.setReplaceDocumentAuthor(true); request.setReplaceDocumentContentAuthor(true); return this.replaceUser(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(); }
RefactoringScriptService implements ScriptService { @Unstable public Job changeDocumentAuthor(DocumentReference oldAuthorReference, DocumentReference newAuthorReference) { ReplaceUserRequest request = getRequestFactory().createReplaceUserRequest(oldAuthorReference, newAuthorReference); request.setReplaceDocumentAuthor(true); request.setReplaceDocumentContentAuthor(true); return this.replaceUser(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();  }