From 32f130b1a5448a89e55fef7e40dbbc23d0573323 Mon Sep 17 00:00:00 2001 From: Ruud Senden <8635138+rsenden@users.noreply.github.com> Date: Tue, 13 Dec 2022 12:29:35 +0100 Subject: [PATCH] fix: `fcli ssc appversion update`: Fix application name not shown in output (fixes #183) --- .../appversion/cli/cmd/SSCAppVersionUpdateCommand.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fcli-ssc/src/main/java/com/fortify/cli/ssc/appversion/cli/cmd/SSCAppVersionUpdateCommand.java b/fcli-ssc/src/main/java/com/fortify/cli/ssc/appversion/cli/cmd/SSCAppVersionUpdateCommand.java index 218384eb54..20efc80092 100644 --- a/fcli-ssc/src/main/java/com/fortify/cli/ssc/appversion/cli/cmd/SSCAppVersionUpdateCommand.java +++ b/fcli-ssc/src/main/java/com/fortify/cli/ssc/appversion/cli/cmd/SSCAppVersionUpdateCommand.java @@ -25,14 +25,17 @@ package com.fortify.cli.ssc.appversion.cli.cmd; import java.util.Map; +import java.util.function.UnaryOperator; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fortify.cli.common.output.cli.cmd.unirest.IUnirestJsonNodeSupplier; import com.fortify.cli.common.output.spi.transform.IActionCommandResultSupplier; +import com.fortify.cli.common.output.spi.transform.IRecordTransformerSupplier; import com.fortify.cli.common.util.StringUtils; import com.fortify.cli.ssc.appversion.cli.mixin.SSCAppVersionResolverMixin; import com.fortify.cli.ssc.appversion.helper.SSCAppVersionDescriptor; +import com.fortify.cli.ssc.appversion.helper.SSCAppVersionHelper; import com.fortify.cli.ssc.appversion_attribute.cli.mixin.SSCAppVersionAttributeUpdateMixin; import com.fortify.cli.ssc.appversion_attribute.helper.SSCAppVersionAttributeUpdateBuilder; import com.fortify.cli.ssc.appversion_user.cli.mixin.SSCAppVersionAuthEntityMixin; @@ -55,7 +58,7 @@ @ReflectiveAccess @Command(name = SSCOutputHelperMixins.Update.CMD_NAME) -public class SSCAppVersionUpdateCommand extends AbstractSSCOutputCommand implements IUnirestJsonNodeSupplier, IActionCommandResultSupplier { +public class SSCAppVersionUpdateCommand extends AbstractSSCOutputCommand implements IUnirestJsonNodeSupplier, IRecordTransformerSupplier, IActionCommandResultSupplier { @Getter @Mixin private SSCOutputHelperMixins.Update outputHelper; @Mixin private SSCAppVersionResolverMixin.PositionalParameter appVersionResolver; @Mixin private SSCIssueTemplateResolverMixin.OptionalFilterSetOption issueTemplateResolver; @@ -79,6 +82,11 @@ public JsonNode getJsonNode(UnirestInstance unirest) { return bulkResponse.body("updatedVersion"); } + @Override + public UnaryOperator getRecordTransformer() { + return SSCAppVersionHelper::renameFields; + } + @Override public String getActionCommandResult() { return "UPDATED";