diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-10-29 14:27:44 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-10-29 17:57:50 +0200 |
commit | bf74c24500acf037e24ff75008bbda83fe1be72b (patch) | |
tree | fd3fcbf82eeb4f38944b94152e96741cd332b4ab /vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java | |
parent | 8cb79d98ec8c9f2b2ec495eca11ca067dbc06acb (diff) |
Test aai_get_service_instance_topology with vf-module placement data
Issue-ID: VID-603
Change-Id: I2ce89cac91417ef4b60a3943da80f0ff03f865ad
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java')
-rw-r--r-- | vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java | 48 |
1 files changed, 9 insertions, 39 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java index 642f941e8..7709a0abc 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIStandardQueryGet.java @@ -1,23 +1,22 @@ package org.onap.simulator.presetGenerator.presets.aai; +import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; +import static org.apache.commons.text.StringEscapeUtils.escapeJson; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.ATT_AIC; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.hvf6; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.StrSubstitutor; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; import org.springframework.http.HttpMethod; -import java.util.UUID; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; -import static org.apache.commons.text.StringEscapeUtils.escapeJson; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.ATT_AIC; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.hvf6; - public class PresetAAIStandardQueryGet extends BaseAAIPreset { private final String instanceId; private final String instanceName; @@ -289,36 +288,7 @@ public class PresetAAIStandardQueryGet extends BaseAAIPreset { private String buildPlacementRelationship() { String relatedTo = StringUtils.equals(instanceType,"vf-module")? "vserver": "tenant"; - return "" + - " {" + - " \"related-to\": \"" + relatedTo + "\"," + - " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + - " \"related-link\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/" + this.placement.lcpRegionId + "/tenants/tenant/" + this.placement.tenantId+ "/vservers/vserver/5eef9f6d-9933-4bc6-9a1a-862d61309437\"," + - " \"relationship-data\": [" + - " {" + - " \"relationship-key\": \"cloud-region.cloud-owner\"," + - " \"relationship-value\": \""+ this.placement.cloudOwner+"\"" + - " }," + - " {" + - " \"relationship-key\": \"cloud-region.cloud-region-id\"," + - " \"relationship-value\": \"" + this.placement.lcpRegionId + "\"" + - " }," + - " {" + - " \"relationship-key\": \"tenant.tenant-id\"," + - " \"relationship-value\": \"" + this.placement.tenantId + "\"" + - " }," + - " {" + - " \"relationship-key\": \"vserver.vserver-id\"," + - " \"relationship-value\": \"5eef9f6d-9933-4bc6-9a1a-862d61309437\"" + - " }" + - " ]," + - " \"related-to-property\": [" + - " {" + - " \"property-key\": \"vserver.vserver-name\"," + - " \"property-value\": \"zolson5bfapn01dns002\"" + - " }" + - " ]" + - " }" ; + return Placement.Util.placementRelationship(relatedTo, placement); } @Override |