diff --git a/integration-tests/src/test/java/org/wildfly/prospero/it/installationmanager/CreateSnapshotTest.java b/integration-tests/src/test/java/org/wildfly/prospero/it/installationmanager/CreateSnapshotTest.java index 9a8e431df..c9d1afabd 100644 --- a/integration-tests/src/test/java/org/wildfly/prospero/it/installationmanager/CreateSnapshotTest.java +++ b/integration-tests/src/test/java/org/wildfly/prospero/it/installationmanager/CreateSnapshotTest.java @@ -84,6 +84,8 @@ public void generateApplyCommand() throws Exception { expected.append(CliConstants.CANDIDATE_DIR).append(" \"").append(Path.of("foo").toAbsolutePath()).append("\""); expected.append(" "); expected.append(CliConstants.YES); + expected.append(" "); + expected.append(CliConstants.REMOVE); final ProvisioningDefinition provisioningDefinition = defaultWfCoreDefinition() .setChannelCoordinates(channelsFile.toString()) @@ -115,6 +117,8 @@ public void generateApplyCommandWithOsShell() throws Exception { expected.append(CliConstants.CANDIDATE_DIR).append(" \"").append(Path.of("foo").toAbsolutePath()).append("\""); expected.append(" "); expected.append(CliConstants.YES); + expected.append(" "); + expected.append(CliConstants.REMOVE); final ProvisioningDefinition provisioningDefinition = defaultWfCoreDefinition() .setChannelCoordinates(channelsFile.toString()) diff --git a/prospero-cli/src/main/java/org/wildfly/prospero/cli/spi/CliProviderImpl.java b/prospero-cli/src/main/java/org/wildfly/prospero/cli/spi/CliProviderImpl.java index 268eba16d..4224f2d39 100644 --- a/prospero-cli/src/main/java/org/wildfly/prospero/cli/spi/CliProviderImpl.java +++ b/prospero-cli/src/main/java/org/wildfly/prospero/cli/spi/CliProviderImpl.java @@ -53,7 +53,8 @@ public String getApplyUpdateCommand(Path installationPath, Path candidatePath) { return CliConstants.Commands.UPDATE + " " + CliConstants.Commands.APPLY + " " + CliConstants.DIR + " " + escape(installationPath.toAbsolutePath()) + " " + CliConstants.CANDIDATE_DIR + " " + escape(candidatePath.toAbsolutePath()) + " " - + CliConstants.YES; + + CliConstants.YES + " " + + CliConstants.REMOVE; } @Override @@ -61,7 +62,8 @@ public String getApplyRevertCommand(Path installationPath, Path candidatePath) { return CliConstants.Commands.REVERT + " " + CliConstants.Commands.APPLY + " " + CliConstants.DIR + " " + escape(installationPath.toAbsolutePath()) + " " + CliConstants.CANDIDATE_DIR + " " + escape(candidatePath.toAbsolutePath()) + " " - + CliConstants.YES; + + CliConstants.YES + " " + + CliConstants.REMOVE; } private String escape(Path absolutePath) {