diff --git a/sop-java-picocli/src/main/java/sop/cli/picocli/commands/DecryptCmd.java b/sop-java-picocli/src/main/java/sop/cli/picocli/commands/DecryptCmd.java index 7b83844..c0fca9a 100644 --- a/sop-java-picocli/src/main/java/sop/cli/picocli/commands/DecryptCmd.java +++ b/sop-java-picocli/src/main/java/sop/cli/picocli/commands/DecryptCmd.java @@ -26,14 +26,14 @@ import java.util.List; exitCodeOnInvalidInput = SOPGPException.UnsupportedOption.EXIT_CODE) public class DecryptCmd extends AbstractSopCmd { + private static final String OPT_SESSION_KEY_OUT = "--session-key-out"; private static final String OPT_WITH_SESSION_KEY = "--with-session-key"; private static final String OPT_WITH_PASSWORD = "--with-password"; - private static final String OPT_NOT_BEFORE = "--not-before"; - private static final String OPT_NOT_AFTER = "--not-after"; - private static final String OPT_SESSION_KEY_OUT = "--session-key-out"; - private static final String OPT_VERIFICATIONS_OUT = "--verifications-out"; - private static final String OPT_VERIFY_WITH = "--verify-with"; private static final String OPT_WITH_KEY_PASSWORD = "--with-key-password"; + private static final String OPT_VERIFICATIONS_OUT = "--verifications-out"; // see SOP-05 + private static final String OPT_VERIFY_WITH = "--verify-with"; + private static final String OPT_NOT_BEFORE = "--verify-not-before"; + private static final String OPT_NOT_AFTER = "--verify-not-after"; @CommandLine.Option( diff --git a/sop-java-picocli/src/test/java/sop/cli/picocli/commands/DecryptCmdTest.java b/sop-java-picocli/src/test/java/sop/cli/picocli/commands/DecryptCmdTest.java index 411f0db..b445a6d 100644 --- a/sop-java-picocli/src/test/java/sop/cli/picocli/commands/DecryptCmdTest.java +++ b/sop-java-picocli/src/test/java/sop/cli/picocli/commands/DecryptCmdTest.java @@ -123,7 +123,7 @@ public class DecryptCmdTest { @Test public void assertVerifyNotAfterAndBeforeDashResultsInMaxTimeRange() throws SOPGPException.UnsupportedOption { - SopCLI.main(new String[] {"decrypt", "--not-before", "-", "--not-after", "-"}); + SopCLI.main(new String[] {"decrypt", "--verify-not-before", "-", "--verify-not-after", "-"}); verify(decrypt, times(1)).verifyNotBefore(AbstractSopCmd.BEGINNING_OF_TIME); verify(decrypt, times(1)).verifyNotAfter(AbstractSopCmd.END_OF_TIME); } @@ -136,7 +136,7 @@ public class DecryptCmdTest { return Math.abs(now.getTime() - argument.getTime()) <= 1000; }; - SopCLI.main(new String[] {"decrypt", "--not-before", "now", "--not-after", "now"}); + SopCLI.main(new String[] {"decrypt", "--verify-not-before", "now", "--verify-not-after", "now"}); verify(decrypt, times(1)).verifyNotAfter(ArgumentMatchers.argThat(isMaxOneSecOff)); verify(decrypt, times(1)).verifyNotBefore(ArgumentMatchers.argThat(isMaxOneSecOff)); } @@ -145,28 +145,28 @@ public class DecryptCmdTest { @ExpectSystemExitWithStatus(1) public void assertMalformedDateInNotBeforeCausesExit1() { // ParserException causes exit(1) - SopCLI.main(new String[] {"decrypt", "--not-before", "invalid"}); + SopCLI.main(new String[] {"decrypt", "--verify-not-before", "invalid"}); } @Test @ExpectSystemExitWithStatus(1) public void assertMalformedDateInNotAfterCausesExit1() { // ParserException causes exit(1) - SopCLI.main(new String[] {"decrypt", "--not-after", "invalid"}); + SopCLI.main(new String[] {"decrypt", "--verify-not-after", "invalid"}); } @Test @ExpectSystemExitWithStatus(SOPGPException.UnsupportedOption.EXIT_CODE) public void assertUnsupportedNotAfterCausesExit37() throws SOPGPException.UnsupportedOption { when(decrypt.verifyNotAfter(any())).thenThrow(new SOPGPException.UnsupportedOption("Setting upper signature date boundary not supported.")); - SopCLI.main(new String[] {"decrypt", "--not-after", "now"}); + SopCLI.main(new String[] {"decrypt", "--verify-not-after", "now"}); } @Test @ExpectSystemExitWithStatus(SOPGPException.UnsupportedOption.EXIT_CODE) public void assertUnsupportedNotBeforeCausesExit37() throws SOPGPException.UnsupportedOption { when(decrypt.verifyNotBefore(any())).thenThrow(new SOPGPException.UnsupportedOption("Setting lower signature date boundary not supported.")); - SopCLI.main(new String[] {"decrypt", "--not-before", "now"}); + SopCLI.main(new String[] {"decrypt", "--verify-not-before", "now"}); } @Test