mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
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>
40 lines
1.2 KiB
Java
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"));
|
|
}
|
|
}
|