From ecf16b747bd2513be0d8fc07214246f0f114b0f3 Mon Sep 17 00:00:00 2001 From: Ruud Senden <8635138+rsenden@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:33:00 +0200 Subject: [PATCH] chore: Various (mostly functional test) fixes --- .../cli/common/output/cli/mixin/OutputHelperMixins.java | 3 +++ .../msp_report/cli/cmd/MspReportCreateCommand.java | 4 ++-- .../ncd_report/cli/cmd/NcdReportCreateCommand.java | 4 ++-- ...nFiltersetSpec.groovy => SSCIssueFilterSetSpec.groovy} | 8 ++++---- .../fortify/cli/ftest/ssc/SSCRolePermissionSpec.groovy | 4 ++-- 5 files changed, 13 insertions(+), 10 deletions(-) rename fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/{SSCAppVersionFiltersetSpec.groovy => SSCIssueFilterSetSpec.groovy} (72%) diff --git a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/cli/mixin/OutputHelperMixins.java b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/cli/mixin/OutputHelperMixins.java index 8d468da762..2cf33ee6bd 100644 --- a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/cli/mixin/OutputHelperMixins.java +++ b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/cli/mixin/OutputHelperMixins.java @@ -85,6 +85,9 @@ public static class Add extends TableNoQuery { public static class Create extends TableNoQuery { public static final String CMD_NAME = "create"; } + public static class CreateWithDetailsOutput extends DetailsNoQuery { + public static final String CMD_NAME = "create"; + } public static class CreateConfig extends TableNoQuery { public static final String CMD_NAME = "create-config"; diff --git a/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/msp_report/cli/cmd/MspReportCreateCommand.java b/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/msp_report/cli/cmd/MspReportCreateCommand.java index 13331ff272..0136fcad5f 100644 --- a/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/msp_report/cli/cmd/MspReportCreateCommand.java +++ b/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/msp_report/cli/cmd/MspReportCreateCommand.java @@ -27,9 +27,9 @@ import picocli.CommandLine.Mixin; import picocli.CommandLine.Option; -@Command(name = OutputHelperMixins.Create.CMD_NAME) +@Command(name = OutputHelperMixins.CreateWithDetailsOutput.CMD_NAME) public final class MspReportCreateCommand extends AbstractConfigurableReportGenerateCommand { - @Getter @Mixin private OutputHelperMixins.Create outputHelper; + @Getter @Mixin private OutputHelperMixins.CreateWithDetailsOutput outputHelper; @Option(names = {"-c","--config"}, required = true, defaultValue = "MspReportConfig.yml") @Getter private File configFile; @Option(names = {"-s","--start-date"}, required = true) diff --git a/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/ncd_report/cli/cmd/NcdReportCreateCommand.java b/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/ncd_report/cli/cmd/NcdReportCreateCommand.java index 4b940b8ca6..3c3f52777f 100644 --- a/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/ncd_report/cli/cmd/NcdReportCreateCommand.java +++ b/fcli-core/fcli-license/src/main/java/com/fortify/cli/license/ncd_report/cli/cmd/NcdReportCreateCommand.java @@ -26,9 +26,9 @@ import picocli.CommandLine.Mixin; import picocli.CommandLine.Option; -@Command(name = OutputHelperMixins.Create.CMD_NAME) +@Command(name = OutputHelperMixins.CreateWithDetailsOutput.CMD_NAME) public final class NcdReportCreateCommand extends AbstractConfigurableReportGenerateCommand { - @Getter @Mixin private OutputHelperMixins.Create outputHelper; + @Getter @Mixin private OutputHelperMixins.CreateWithDetailsOutput outputHelper; @Option(names = {"-c","--config"}, required = true, defaultValue = "NcdReportConfig.yml") @Getter private File configFile; diff --git a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCAppVersionFiltersetSpec.groovy b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCIssueFilterSetSpec.groovy similarity index 72% rename from fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCAppVersionFiltersetSpec.groovy rename to fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCIssueFilterSetSpec.groovy index edf8cc4f07..fe64176f42 100644 --- a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCAppVersionFiltersetSpec.groovy +++ b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCIssueFilterSetSpec.groovy @@ -14,11 +14,11 @@ import spock.lang.Shared import spock.lang.Stepwise @Prefix("ssc.appversion-filterset") @FcliSession(SSC) @Stepwise -class SSCAppVersionFiltersetSpec extends FcliBaseSpec { +class SSCIssueFilterSetSpec extends FcliBaseSpec { @Shared @AutoCleanup SSCAppVersionSupplier versionSupplier = new SSCAppVersionSupplier() def "list"() { - def args = "ssc appversion-filterset list --appversion " + versionSupplier.version.appName + ":" + versionSupplier.version.versionName + " --store filtersets" + def args = "ssc issue list-filtersets --appversion " + versionSupplier.version.appName + ":" + versionSupplier.version.versionName + " --store filtersets" when: def result = Fcli.run(args) then: @@ -30,7 +30,7 @@ class SSCAppVersionFiltersetSpec extends FcliBaseSpec { } def "get.byId"() { - def args = "ssc appversion-filterset get ::filtersets::get(0).guid --appversion " + versionSupplier.version.appName + ":" + versionSupplier.version.versionName + def args = "ssc issue get-filterset ::filtersets::get(0).guid --appversion " + versionSupplier.version.appName + ":" + versionSupplier.version.versionName when: def result = Fcli.run(args) then: @@ -41,7 +41,7 @@ class SSCAppVersionFiltersetSpec extends FcliBaseSpec { } def "get.byTitle"() { - def args = "ssc appversion-filterset get Security\\ Auditor\\ View --appversion " + versionSupplier.version.appName + ":" + versionSupplier.version.versionName + def args = "ssc issue get-filterset Security\\ Auditor\\ View --appversion " + versionSupplier.version.appName + ":" + versionSupplier.version.versionName when: def result = Fcli.run(args) then: diff --git a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCRolePermissionSpec.groovy b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCRolePermissionSpec.groovy index 4e97338418..c382332cde 100644 --- a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCRolePermissionSpec.groovy +++ b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/ssc/SSCRolePermissionSpec.groovy @@ -33,7 +33,7 @@ class SSCRolePermissionSpec extends FcliBaseSpec { then: verifyAll(result.stdout) { size()>0 - it[0].replace(' ', '').equals("IdNameDependsonpermissionDescription") + it[0].replace(' ', '').equals("IdNameDescription") it.any { it.startsWith(" user_manage") } } } @@ -50,7 +50,7 @@ class SSCRolePermissionSpec extends FcliBaseSpec { } def "get.byName"() { - def args = "ssc role-permission get View\\ users" + def args = "ssc role get-permission View\\ users" when: def result = Fcli.run(args) then: