diff --git a/app/server/appsmith-server/src/test/it/com/appsmith/server/git/GitBranchesIT.java b/app/server/appsmith-server/src/test/it/com/appsmith/server/git/GitBranchesIT.java index aa2d7b4f3942..cba8496fd85e 100644 --- a/app/server/appsmith-server/src/test/it/com/appsmith/server/git/GitBranchesIT.java +++ b/app/server/appsmith-server/src/test/it/com/appsmith/server/git/GitBranchesIT.java @@ -1,12 +1,9 @@ package com.appsmith.server.git; import com.appsmith.external.dtos.GitBranchDTO; -import com.appsmith.external.dtos.GitRefDTO; import com.appsmith.external.dtos.GitStatusDTO; import com.appsmith.external.dtos.MergeStatusDTO; -import com.appsmith.external.git.constants.ce.RefType; import com.appsmith.git.configurations.GitServiceConfig; -import com.appsmith.git.dto.CommitDTO; import com.appsmith.server.applications.base.ApplicationService; import com.appsmith.server.configurations.ProjectProperties; import com.appsmith.server.constants.ArtifactType; @@ -17,16 +14,15 @@ import com.appsmith.server.domains.GitArtifactMetadata; import com.appsmith.server.domains.GitProfile; import com.appsmith.server.dtos.AutoCommitResponseDTO; +import com.appsmith.server.dtos.GitCommitDTO; import com.appsmith.server.dtos.GitConnectDTO; import com.appsmith.server.dtos.GitMergeDTO; import com.appsmith.server.dtos.GitPullDTO; import com.appsmith.server.git.autocommit.AutoCommitService; -import com.appsmith.server.git.central.CentralGitService; -import com.appsmith.server.git.central.GitType; +import com.appsmith.server.git.common.CommonGitService; import com.appsmith.server.git.resolver.GitArtifactHelperResolver; import com.appsmith.server.git.templates.contexts.GitContext; import com.appsmith.server.git.templates.providers.GitBranchesTestTemplateProvider; -import com.appsmith.server.services.ConsolidatedAPIService; import com.appsmith.server.services.GitArtifactHelper; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.Status; @@ -56,6 +52,7 @@ import static com.appsmith.server.exceptions.AppsmithError.GIT_MERGE_FAILED_LOCAL_CHANGES; import static com.appsmith.server.git.autocommit.AutoCommitEventHandlerImpl.AUTO_COMMIT_MSG_FORMAT; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.fail; /** * This integration test suite validates the end-to-end Git workflow for artifacts, performing a sequence of @@ -139,7 +136,7 @@ public class GitBranchesIT { GitServerInitializerExtension gitServerInitializerExtension; @Autowired - CentralGitService centralGitService; + CommonGitService commonGitService; @Autowired GitTestUtils gitTestUtils; @Autowired @@ -152,8 +149,6 @@ public class GitBranchesIT { ProjectProperties projectProperties; @Autowired ApplicationService applicationService; - @Autowired - ConsolidatedAPIService consolidatedAPIService; final String ORIGIN = "https://foo.bar.com"; @@ -172,7 +167,7 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc // TODO: // - Move the filePath variable to be relative, so that template name and repo name is prettier // - Is it possible to use controller layer here? Might help with also including web filters in IT - Artifact artifact = centralGitService.connectArtifactToGit(artifactId, gitContext.getArtifactType(), connectDTO, ORIGIN, GitType.FILE_SYSTEM) + Artifact artifact = commonGitService.connectArtifactToGit(artifactId, connectDTO, ORIGIN, gitContext.getArtifactType()) .block(); assertThat(artifact).isNotNull(); @@ -205,8 +200,7 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc assertThat(firstCommit.getFullMessage()).isEqualTo(DEFAULT_COMMIT_MESSAGE + GitDefaultCommitMessage.CONNECT_FLOW.getReason()); topOfCommits = firstCommit.getId(); - // TODO: Check why there is ane extra commit - assertThat(commitIterator.hasNext()).isTrue(); + assertThat(commitIterator.hasNext()).isFalse(); // Assert that git directory is clean Status status = git.status().call(); @@ -227,9 +221,8 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc long startTime = System.currentTimeMillis(), currentTime = System.currentTimeMillis(); while (!autoCommitProgress.equals(AutoCommitResponseDTO.AutoCommitResponse.IDLE)) { Thread.sleep(500); - //TODO: Undo this if (currentTime - startTime > 2000) { -// fail("Auto-commit took too long"); + fail("Auto-commit took too long"); } autoCommitProgress = getAutocommitProgress(artifactId, artifact, artifactMetadata); currentTime = System.currentTimeMillis(); @@ -245,15 +238,8 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc assertThat(commitIterator.hasNext()).isTrue(); RevCommit autoCommit = commitIterator.next(); - /* - org.opentest4j.AssertionFailedError: - expected: "System generated commit, to support new features in Appsmith UNKNOWN" - but was: "System generated commit, initial commit" - Expected :"System generated commit, to support new features in Appsmith UNKNOWN" - Actual :"System generated commit, initial commit" - - */ assertThat(autoCommit.getFullMessage()).isEqualTo(String.format(AUTO_COMMIT_MSG_FORMAT, projectProperties.getVersion())); + assertThat(commitIterator.hasNext()).isTrue(); RevCommit firstCommit = commitIterator.next(); assertThat(firstCommit.getId()).isEqualTo(topOfCommits); @@ -268,20 +254,21 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc assertThat(artifactMetadata.getBranchProtectionRules()).isNullOrEmpty(); // Check that the status is clean - GitStatusDTO statusDTO = centralGitService.getStatus(artifactId, artifactType, true, GitType.FILE_SYSTEM).block(); + GitStatusDTO statusDTO = commonGitService.getStatus(artifactId, true, artifactType).block(); assertThat(statusDTO).isNotNull(); assertThat(statusDTO.getIsClean()).isTrue(); assertThat(statusDTO.getAheadCount()).isEqualTo(0); assertThat(statusDTO.getBehindCount()).isEqualTo(0); // Check that pull when not required, still goes through - GitPullDTO gitPullDTO = centralGitService.pullArtifact(artifactId, artifactType, GitType.FILE_SYSTEM).block(); + GitPullDTO gitPullDTO = commonGitService.pullArtifact(artifactId, artifactType).block(); assertThat(gitPullDTO).isNotNull(); // Check that commit says that there is nothing to commit - CommitDTO newCommitDTO = new CommitDTO(); - newCommitDTO.setMessage("Unused message"); - String commitResponse = centralGitService.commitArtifact(newCommitDTO, artifactId, artifactType, GitType.FILE_SYSTEM) + GitCommitDTO commitDTO = new GitCommitDTO(); + commitDTO.setCommitMessage("Unused message"); + commitDTO.setDoPush(false); + String commitResponse = commonGitService.commitArtifact(commitDTO, artifactId, artifactType) .block(); assertThat(commitResponse).contains(EMPTY_COMMIT_ERROR_MESSAGE); @@ -296,23 +283,24 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc } // Check that discard, even when not required, goes through - Artifact discardedArtifact = centralGitService.discardChanges(artifactId, artifactType, GitType.FILE_SYSTEM).block(); + Artifact discardedArtifact = commonGitService.discardChanges(artifactId, artifactType).block(); assertThat(discardedArtifact).isNotNull(); // Make a change in the artifact to trigger a diff gitTestUtils.createADiffInArtifact(artifact).block(); // Check that the status is not clean - GitStatusDTO statusDTO2 = centralGitService.getStatus(artifactId, artifactType, true, GitType.FILE_SYSTEM).block(); + GitStatusDTO statusDTO2 = commonGitService.getStatus(artifactId, true, artifactType).block(); assertThat(statusDTO2).isNotNull(); assertThat(statusDTO2.getIsClean()).isFalse(); assertThat(statusDTO2.getAheadCount()).isEqualTo(0); assertThat(statusDTO2.getBehindCount()).isEqualTo(0); // Check that commit makes the custom message be the top of the log - CommitDTO commitDTO2 = new CommitDTO(); - commitDTO2.setMessage("Custom message"); - String commitResponse2 = centralGitService.commitArtifact(commitDTO2, artifactId, artifactType, GitType.FILE_SYSTEM) + GitCommitDTO commitDTO2 = new GitCommitDTO(); + commitDTO2.setCommitMessage("Custom message"); + commitDTO2.setDoPush(true); + String commitResponse2 = commonGitService.commitArtifact(commitDTO2, artifactId, artifactType) .block(); assertThat(commitResponse2).contains("Committed successfully!"); @@ -332,7 +320,7 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc } // Check that status is clean again - GitStatusDTO statusDTO3 = centralGitService.getStatus(artifactId, artifactType, true, GitType.FILE_SYSTEM).block(); + GitStatusDTO statusDTO3 = commonGitService.getStatus(artifactId, true, artifactType).block(); assertThat(statusDTO3).isNotNull(); assertThat(statusDTO3.getIsClean()).isTrue(); assertThat(statusDTO3.getAheadCount()).isEqualTo(0); @@ -342,30 +330,30 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc gitTestUtils.createADiffInArtifact(artifact).block(); // Check that status in not clean - GitStatusDTO statusDTO4 = centralGitService.getStatus(artifactId, artifactType, true, GitType.FILE_SYSTEM ).block(); + GitStatusDTO statusDTO4 = commonGitService.getStatus(artifactId, true, artifactType).block(); assertThat(statusDTO4).isNotNull(); assertThat(statusDTO4.getIsClean()).isFalse(); assertThat(statusDTO4.getAheadCount()).isEqualTo(0); assertThat(statusDTO4.getBehindCount()).isEqualTo(0); // Protect the master branch - List protectedBranches = centralGitService.updateProtectedBranches(artifactId, artifactType, List.of(branch)).block(); + List protectedBranches = commonGitService.updateProtectedBranches(artifactId, List.of(branch), artifactType).block(); assertThat(protectedBranches).containsExactly(branch); // Now try to commit, and check that it fails - CommitDTO commitDTO3 = new CommitDTO(); - commitDTO3.setMessage("Failed commit"); - Mono commitResponse3Mono = centralGitService.commitArtifact(commitDTO3, artifactId, artifactType, GitType.FILE_SYSTEM); + GitCommitDTO commitDTO3 = new GitCommitDTO(); + commitDTO3.setCommitMessage("Failed commit"); + commitDTO3.setDoPush(false); + Mono commitResponse3Mono = commonGitService.commitArtifact(commitDTO3, artifactId, artifactType); StepVerifier.create(commitResponse3Mono) .expectErrorSatisfies(e -> assertThat(e.getMessage()).contains("Cannot commit to protected branch")) .verify(); // Create a new branch foo from master, check that the commit for new branch is created as system generated // On top of the previous custom commit - GitRefDTO gitRefDTO = new GitRefDTO(); - gitRefDTO.setRefName("foo"); - gitRefDTO.setRefType(RefType.branch); - Artifact fooArtifact = centralGitService.createReference(artifactId, artifactType, gitRefDTO, GitType.FILE_SYSTEM).block(); + GitBranchDTO fooBranchDTO = new GitBranchDTO(); + fooBranchDTO.setBranchName("foo"); + Artifact fooArtifact = commonGitService.createBranch(artifactId, fooBranchDTO, artifactType).block(); assertThat(fooArtifact).isNotNull(); String fooArtifactId = fooArtifact.getId(); @@ -373,28 +361,30 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc assertThat(fooMetadata.getRefName()).isEqualTo("foo"); try (Git git = Git.open(path.toFile())) { - // since the new flow discards the parent branch, - // the parent branch is checkedOut at last. + branch = git.log().getRepository().getBranch(); + assertThat(branch).isEqualTo(fooMetadata.getRefName()); Iterable commits = git.log().call(); Iterator commitIterator = commits.iterator(); RevCommit newCommit = commitIterator.next(); - assertThat(newCommit.getId()).isEqualTo(topOfCommits); + assertThat(newCommit.getFullMessage()).contains("branch: foo"); + + assertThat(commitIterator.next().getId()).isEqualTo(topOfCommits); + + topOfCommits = newCommit.getId(); } - // Since the status - // Check that status on foo, it should be dirty - GitStatusDTO statusDTO5 = centralGitService.getStatus(fooArtifactId, artifactType, true, GitType.FILE_SYSTEM).block(); + // Check that status on foo is clean again + GitStatusDTO statusDTO5 = commonGitService.getStatus(fooArtifactId, true, artifactType).block(); assertThat(statusDTO5).isNotNull(); - assertThat(statusDTO5.getIsClean()).isFalse(); + assertThat(statusDTO5.getIsClean()).isTrue(); assertThat(statusDTO5.getAheadCount()).isEqualTo(0); assertThat(statusDTO5.getBehindCount()).isEqualTo(0); // Create another branch bar from foo - GitRefDTO barBranchDTO = new GitRefDTO(); - barBranchDTO.setRefName("bar"); - barBranchDTO.setRefType(RefType.branch); - Artifact barArtifact = centralGitService.createReference(fooArtifactId, artifactType, barBranchDTO, GitType.FILE_SYSTEM).block(); + GitBranchDTO barBranchDTO = new GitBranchDTO(); + barBranchDTO.setBranchName("bar"); + Artifact barArtifact = commonGitService.createBranch(fooArtifactId, barBranchDTO, artifactType).block(); assertThat(barArtifact).isNotNull(); String barArtifactId = barArtifact.getId(); @@ -402,40 +392,26 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc assertThat(barMetadata.getRefName()).isEqualTo("bar"); try (Git git = Git.open(path.toFile())) { + branch = git.log().getRepository().getBranch(); + assertThat(branch).isEqualTo(barMetadata.getRefName()); + Iterable commits = git.log().call(); Iterator commitIterator = commits.iterator(); + assertThat(commitIterator.next().getId()).isEqualTo(topOfCommits); } - // Check that status on foo, - // it should be clean as the diff is transferred to new branch bar - GitStatusDTO fooStatusDTO = centralGitService.getStatus(fooArtifactId, artifactType, true, GitType.FILE_SYSTEM).block(); - assertThat(fooStatusDTO).isNotNull(); - assertThat(fooStatusDTO.getIsClean()).isTrue(); - assertThat(fooStatusDTO.getAheadCount()).isEqualTo(0); - assertThat(fooStatusDTO.getBehindCount()).isEqualTo(0); - - // Check that status on bar, it should be dirty - GitStatusDTO barStatusDTO = centralGitService.getStatus(barArtifactId, artifactType, true, GitType.FILE_SYSTEM).block(); - assertThat(barStatusDTO).isNotNull(); - assertThat(barStatusDTO.getIsClean()).isFalse(); - assertThat(barStatusDTO.getAheadCount()).isEqualTo(0); - assertThat(barStatusDTO.getBehindCount()).isEqualTo(0); - - Artifact discardBarBranch = centralGitService.discardChanges(barArtifactId, artifactType, GitType.FILE_SYSTEM).block(); - assertThat(discardBarBranch).isNotNull(); - // Check merge status to foo shows no action required // bar -> foo GitMergeDTO gitMergeDTO = new GitMergeDTO(); gitMergeDTO.setDestinationBranch("foo"); gitMergeDTO.setSourceBranch("bar"); - MergeStatusDTO mergeStatusDTO = centralGitService.isBranchMergable(barArtifactId, artifactType, gitMergeDTO, GitType.FILE_SYSTEM ).block(); + MergeStatusDTO mergeStatusDTO = commonGitService.isBranchMergeable(barArtifactId, gitMergeDTO, artifactType).block(); assertThat(mergeStatusDTO).isNotNull(); assertThat(mergeStatusDTO.getStatus()).isEqualTo("ALREADY_UP_TO_DATE"); // Delete foo locally and re-populate from remote - List branchList = centralGitService.listBranchForArtifact(artifactId, artifactType, false, GitType.FILE_SYSTEM) + List branchList = commonGitService.listBranchForArtifact(artifactId, false, artifactType) .flatMapMany(Flux::fromIterable) .map(GitBranchDTO::getBranchName) .collectList() @@ -448,7 +424,7 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc barMetadata.getRefName(), "origin/" + barMetadata.getRefName()); - Mono deleteBranchAttemptMono = centralGitService.deleteGitReference(artifactId, artifactType, gitRefDTO, GitType.FILE_SYSTEM); + Mono deleteBranchAttemptMono = commonGitService.deleteBranch(artifactId, "foo", artifactType); StepVerifier .create(deleteBranchAttemptMono) .expectErrorSatisfies(e -> assertThat(e.getMessage()).contains("Cannot delete current checked out branch")) @@ -461,12 +437,9 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc git.checkout().setName("bar").call(); } - GitRefDTO deleteFooDTO = new GitRefDTO(); - deleteFooDTO.setRefType(RefType.branch); - deleteFooDTO.setRefName("foo"); - centralGitService.deleteGitReference(artifactId, artifactType, deleteFooDTO, GitType.FILE_SYSTEM).block(); + commonGitService.deleteBranch(artifactId, "foo", artifactType).block(); - List branchList2 = centralGitService.listBranchForArtifact(artifactId, artifactType, false, GitType.FILE_SYSTEM) + List branchList2 = commonGitService.listBranchForArtifact(artifactId, false, artifactType) .flatMapMany(Flux::fromIterable) .map(GitBranchDTO::getBranchName) .collectList() @@ -478,13 +451,10 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc barMetadata.getRefName(), "origin/" + barMetadata.getRefName()); - GitRefDTO checkoutFooDTO = new GitRefDTO(); - checkoutFooDTO.setRefName("origin/foo"); - checkoutFooDTO.setRefType(RefType.branch); - Artifact checkedOutFooArtifact = centralGitService.checkoutReference(artifactId, artifactType, checkoutFooDTO, true, GitType.FILE_SYSTEM).block(); + Artifact checkedOutFooArtifact = commonGitService.checkoutBranch(artifactId, "origin/foo", true, artifactType).block(); assertThat(checkedOutFooArtifact).isNotNull(); - List branchList3 = centralGitService.listBranchForArtifact(artifactId, artifactType, false, GitType.FILE_SYSTEM) + List branchList3 = commonGitService.listBranchForArtifact(artifactId, false, artifactType) .flatMapMany(Flux::fromIterable) .map(GitBranchDTO::getBranchName) .collectList() @@ -511,14 +481,14 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc // Make more changes on foo and attempt discard gitTestUtils.createADiffInArtifact(checkedOutFooArtifact).block(); - GitStatusDTO discardableStatus = centralGitService.getStatus(checkedOutFooArtifact.getId(), artifactType, false, GitType.FILE_SYSTEM).block(); + GitStatusDTO discardableStatus = commonGitService.getStatus(checkedOutFooArtifact.getId(), false, artifactType).block(); assertThat(discardableStatus).isNotNull(); assertThat(discardableStatus.getIsClean()).isFalse(); - Artifact discardedFoo = centralGitService.discardChanges(checkedOutFooArtifact.getId(), artifactType, GitType.FILE_SYSTEM).block(); + Artifact discardedFoo = commonGitService.discardChanges(checkedOutFooArtifact.getId(), artifactType).block(); - GitStatusDTO discardedStatus = centralGitService.getStatus(checkedOutFooArtifact.getId(), artifactType, false, GitType.FILE_SYSTEM).block(); + GitStatusDTO discardedStatus = commonGitService.getStatus(checkedOutFooArtifact.getId(), false, artifactType).block(); assertThat(discardedStatus).isNotNull(); // TODO: Why is this not clean? @@ -533,53 +503,51 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc GitMergeDTO gitMergeDTO2 = new GitMergeDTO(); gitMergeDTO2.setSourceBranch("bar"); gitMergeDTO2.setDestinationBranch("master"); - MergeStatusDTO mergeStatusDTO2 = centralGitService.isBranchMergable(barArtifactId, artifactType, gitMergeDTO2, GitType.FILE_SYSTEM).block(); + MergeStatusDTO mergeStatusDTO2 = commonGitService.isBranchMergeable(barArtifactId, gitMergeDTO2, artifactType).block(); assertThat(mergeStatusDTO2).isNotNull(); assertThat(mergeStatusDTO2.isMergeAble()).isFalse(); - assertThat(mergeStatusDTO2.getMessage()).contains(GIT_MERGE_FAILED_LOCAL_CHANGES.getMessage("bar")); + assertThat(mergeStatusDTO2.getMessage()).isEqualTo(GIT_MERGE_FAILED_LOCAL_CHANGES.getMessage("bar")); // Create a new branch baz and check for new commit - GitRefDTO gitBranchDTO = new GitRefDTO(); - gitBranchDTO.setRefName("baz"); - gitBranchDTO.setRefType(RefType.branch); - Artifact bazArtifact = centralGitService.createReference(barArtifactId, artifactType, gitBranchDTO, GitType.FILE_SYSTEM).block(); + GitBranchDTO gitBranchDTO = new GitBranchDTO(); + gitBranchDTO.setBranchName("baz"); + Artifact bazArtifact = commonGitService.createBranch(barArtifactId, gitBranchDTO, artifactType).block(); + assertThat(bazArtifact).isNotNull(); try (Git git = Git.open(path.toFile())) { Iterable commits = git.log().call(); Iterator commitIterator = commits.iterator(); RevCommit newCommit = commitIterator.next(); - assertThat(newCommit.getId()).isEqualTo(topOfCommits); - } + assertThat(newCommit.getFullMessage()).contains("branch: baz"); - GitStatusDTO bazStatus = centralGitService.getStatus(bazArtifact.getId(), artifactType, true, GitType.FILE_SYSTEM).block(); - assertThat(bazStatus).isNotNull(); - assertThat(bazStatus.getIsClean()).isFalse(); + assertThat(commitIterator.next().getId()).isEqualTo(topOfCommits); - centralGitService.discardChanges(bazArtifact.getId(), artifactType, GitType.FILE_SYSTEM).block(); + topOfCommits = newCommit.getId(); + } - GitStatusDTO bazStatus2 = centralGitService.getStatus(bazArtifact.getId(), artifactType, true, GitType.FILE_SYSTEM).block(); - assertThat(bazStatus2).isNotNull(); - assertThat(bazStatus2.getIsClean()).isTrue(); + // TODO: We're having to discard on bar because + // create branch today retains uncommitted change on source branch as well + // We will need to update this line once that is fixed. + // It won't get caught in tests otherwise since this discard would be a redundant op + commonGitService.discardChanges(barArtifactId, artifactType).block(); GitMergeDTO gitMergeDTO3 = new GitMergeDTO(); gitMergeDTO3.setSourceBranch("baz"); gitMergeDTO3.setDestinationBranch("bar"); - MergeStatusDTO mergeStatusDTO3 = centralGitService.isBranchMergable(bazArtifact.getId(), artifactType, gitMergeDTO3, GitType.FILE_SYSTEM).block(); + MergeStatusDTO mergeStatusDTO3 = commonGitService.isBranchMergeable(barArtifactId, gitMergeDTO3, artifactType).block(); + assertThat(mergeStatusDTO3).isNotNull(); assertThat(mergeStatusDTO3.isMergeAble()).isTrue(); - GitStatusDTO barStatus2 = centralGitService.getStatus(barArtifactId, artifactType, true, GitType.FILE_SYSTEM).block(); - assertThat(barStatus2).isNotNull(); - assertThat(barStatus2.getIsClean()).isTrue(); - - MergeStatusDTO barToBazMergeStatus = centralGitService.mergeBranch(bazArtifact.getId(), artifactType, gitMergeDTO3, GitType.FILE_SYSTEM).block(); + // Merge bar to master and check log of commits on foo is same as bar + MergeStatusDTO barToBazMergeStatus = commonGitService.mergeBranch(barArtifactId, gitMergeDTO3, artifactType).block(); assertThat(barToBazMergeStatus).isNotNull(); assertThat(barToBazMergeStatus.isMergeAble()).isTrue(); - assertThat(barToBazMergeStatus.getStatus()).contains("ALREADY_UP_TO_DATE"); + assertThat(barToBazMergeStatus.getStatus()).contains("FAST_FORWARD"); // Since fast-forward should succeed here, top of commit should not change try (Git git = Git.open(path.toFile())) { @@ -589,7 +557,7 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc } // Disconnect artifact and verify non-existence of `foo`, `bar` and `baz` - Artifact disconnectedArtifact = centralGitService.detachRemote(artifactId, artifactType, GitType.FILE_SYSTEM).block(); + Artifact disconnectedArtifact = commonGitService.detachRemote(artifactId, artifactType).block(); assertThat(disconnectedArtifact).isNotNull(); assertThat(disconnectedArtifact.getGitArtifactMetadata()).isNull(); @@ -610,7 +578,7 @@ void test(GitContext gitContext, ExtensionContext extensionContext) throws IOExc } private AutoCommitResponseDTO.AutoCommitResponse getAutocommitProgress(String artifactId, Artifact artifact, GitArtifactMetadata artifactMetadata) { - AutoCommitResponseDTO autoCommitProgress = centralGitService.getAutoCommitProgress(artifactId, artifact.getArtifactType(), artifactMetadata.getRefName()).block(); + AutoCommitResponseDTO autoCommitProgress = commonGitService.getAutoCommitProgress(artifactId, artifactMetadata.getRefName(), artifact.getArtifactType()).block(); assertThat(autoCommitProgress).isNotNull(); return autoCommitProgress.getAutoCommitResponse();