Skip to content

Commit

Permalink
fix: fcli ssc appversion update: Fix application name not shown in …
Browse files Browse the repository at this point in the history
…output (fixes #183)
  • Loading branch information
rsenden committed Dec 14, 2022
1 parent c7ebb98 commit 32f130b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -79,6 +82,11 @@ public JsonNode getJsonNode(UnirestInstance unirest) {
return bulkResponse.body("updatedVersion");
}

@Override
public UnaryOperator<JsonNode> getRecordTransformer() {
return SSCAppVersionHelper::renameFields;
}

@Override
public String getActionCommandResult() {
return "UPDATED";
Expand Down

0 comments on commit 32f130b

Please sign in to comment.