Files
floci-cli/src/test/java/io/floci/cli/unit/RemovedFlagsTest.java
T
Hector Ventura 1a7e84cd23 fix(cli): remove doctor --fix and services --mode, which did nothing (#53)
doctor --fix only hid the hint text and services --mode filtered nothing, because the server does not report service modes. Both flags are removed rather than kept as promises; doctor's summary now points at the Fix line under each failed check. services --mode can return once the server exposes service metadata (BL-065).

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-10 21:38:43 -05:00

40 lines
1.2 KiB
Java

package io.floci.cli.unit;
import io.floci.cli.FlociCli;
import io.floci.cli.config.ProfileStore;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import picocli.CommandLine;
import picocli.CommandLine.UnmatchedArgumentException;
import java.nio.file.Path;
import static org.junit.jupiter.api.Assertions.*;
/**
* BL-051, BL-052: doctor --fix fixed nothing and services --mode filtered nothing, so both were
* removed rather than kept as promises. They stay rejected in every product tree.
*/
class RemovedFlagsTest {
@TempDir
Path tempDir;
private CommandLine cli() {
return FlociCli.buildCommandLine(new ProfileStore(tempDir));
}
@ParameterizedTest
@ValueSource(strings = {"aws", "gcp", "az", "oci"})
void doctorHasNoFixFlag(String product) {
assertThrows(UnmatchedArgumentException.class, () -> cli().parseArgs(product, "doctor", "--fix"));
}
@ParameterizedTest
@ValueSource(strings = {"aws", "gcp", "az", "oci"})
void servicesHasNoModeFlag(String product) {
assertThrows(UnmatchedArgumentException.class, () -> cli().parseArgs(product, "services", "--mode", "docker"));
}
}