From a746d9853f676ee34b59765a41b08eefed8f0c96 Mon Sep 17 00:00:00 2001 From: Xabier Laiseca Date: Mon, 22 Jul 2019 15:05:41 +0100 Subject: [PATCH] expected artifacts from hashmap to map --- .../pipelinetemplate/TemplatedPipelineRequest.java | 6 +++--- .../v1schema/V1SchemaExecutionGenerator.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/TemplatedPipelineRequest.java b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/TemplatedPipelineRequest.java index 4d977eecdf0..6c1b4c88f8e 100644 --- a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/TemplatedPipelineRequest.java +++ b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/TemplatedPipelineRequest.java @@ -26,7 +26,7 @@ public class TemplatedPipelineRequest { String id; String schema; String type; - List> expectedArtifacts; + List> expectedArtifacts; Map trigger = new HashMap<>(); Map config; Map template; @@ -129,11 +129,11 @@ public boolean isKeepWaitingPipelines() { return keepWaitingPipelines; } - public void setExpectedArtifacts(List> expectedArtifacts) { + public void setExpectedArtifacts(List> expectedArtifacts) { this.expectedArtifacts = expectedArtifacts; } - public List> getExpectedArtifacts() { + public List> getExpectedArtifacts() { return this.expectedArtifacts; } } diff --git a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaExecutionGenerator.java b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaExecutionGenerator.java index bf56d5fb606..27ce1ed6081 100644 --- a/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaExecutionGenerator.java +++ b/orca-pipelinetemplate/src/main/java/com/netflix/spinnaker/orca/pipelinetemplate/v1schema/V1SchemaExecutionGenerator.java @@ -160,7 +160,7 @@ private void addExpectedArtifacts( TemplateConfiguration configuration, TemplatedPipelineRequest request) { - List> mergedExpectedArtifacts = + List> mergedExpectedArtifacts = mergeExpectedArtifact( emptyListIfNull(configuration.getConfiguration().getExpectedArtifacts()), emptyListIfNull(request.getExpectedArtifacts())); @@ -175,13 +175,13 @@ private void addExpectedArtifacts( pipeline.put("expectedArtifacts", mergedExpectedArtifacts); } - private List> emptyListIfNull(List> eas) { + private List> emptyListIfNull(List> eas) { return Optional.ofNullable(eas).orElse(Collections.emptyList()); } - private List> mergeExpectedArtifact( - List> eas1, List> eas2) { - HashMap> mergedByName = new HashMap<>(); + private List> mergeExpectedArtifact( + List> eas1, List> eas2) { + HashMap> mergedByName = new HashMap<>(); eas1.forEach(artifact -> mergedByName.put(String.valueOf(artifact.get("id")), artifact)); eas2.forEach(artifact -> mergedByName.put(String.valueOf(artifact.get("id")), artifact));