diff options
author | 2018-08-12 12:20:55 +0000 | |
---|---|---|
committer | 2018-08-12 12:20:55 +0000 | |
commit | 91b057331b92ecf7f3c2d495681b05295dc8346c (patch) | |
tree | 0ce3f821ada8ad518784f7f9869db4b537ba3237 /vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java | |
parent | 9152b2ae03c4751b492a219993d85d522c58b383 (diff) | |
parent | 4a4dcc5185f8ba5a28c7f9fef509f32c0c2389e6 (diff) |
Merge "vid-automation selenium tests"
Diffstat (limited to 'vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java')
-rw-r--r-- | vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java new file mode 100644 index 000000000..9c8f82d18 --- /dev/null +++ b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/aai/PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing.java @@ -0,0 +1,181 @@ +package org.opencomp.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.opencomp.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing extends BaseAAIPreset { + + private String cloudOwner; + private String cloudRegionId; + private String networkFunction; + private final String type = "L3-NETWORK"; + private final String role = "SUB-INTERFACE"; + + public PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing(String cloudOwner, String cloudRegionId, String networkFunction) { + this.cloudOwner = cloudOwner; + this.cloudRegionId = cloudRegionId; + this.networkFunction = networkFunction; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.PUT; + } + + @Override + public String getReqPath() { + return getRootPath() + "/query"; + } + + @Override + public Map<String, List> getQueryParams() { + return ImmutableMap.of( + "format", Collections.singletonList("resource") + ); + } + + @Override + public Object getRequestBody() { + return ImmutableMap.of( + "start", ImmutableList.of("cloud-infrastructure/cloud-regions/cloud-region/" + getCloudOwner() + "/" + getCloudRegionId()), + "query", "query/instance-group-byCloudRegion?type=" + type + "&role=" + role + "&function=" + getNetworkFunction() + ); + } + + public String getCloudOwner() { + return cloudOwner; + } + + public String getCloudRegionId() { + return cloudRegionId; + } + + public String getNetworkFunction() { + return networkFunction; + } + + @Override + public Object getResponseBody() { + return "{\n" + + " \"results\": [\n" + + " {\n" + + " \"instance-group\": {\n" + + " \"instance-group-role\": \"JZmha7QSS4tJ\",\n" + + " \"model-invariant-id\": \"model-id3\",\n" + + " \"model-version-id\": \"version3\",\n" + + " \"id\": \"AAI-12002-test3-vm230w\",\n" + + " \"description\": \"a9DEa0kpY\",\n" + + " \"resource-version\": \"1520888659539\",\n" + + " \"instance-group-name\": \"wKmBXiO1xm8bK\",\n" + + " \"instance-group-function\": \"testfunction2\",\n" + + " \"relationship-list\": {\n" + + " \"relationship\": [\n" + + " {\n" + + " \"related-to\": \"cloud-region\",\n" + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + + " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\n" + + " \"relationship-data\": [\n" + + " {\n" + + " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + + " \"relationship-value\": \"AAI-12002-vm230w\"\n" + + " },\n" + + " {\n" + + " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + + " \"relationship-value\": \"AAI-region-vm230w\"\n" + + " }\n" + + " ],\n" + + " \"related-to-property\": [\n" + + " {\n" + + " \"property-key\": \"cloud-region.owner-defined-type\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"instance-group\": {\n" + + " \"instance-group-role\": \"JZmha7QSS4tJ\",\n" + + " \"model-invariant-id\": \"model-id1\",\n" + + " \"model-version-id\": \"version1\",\n" + + " \"id\": \"AAI-12002-test1-vm230w\",\n" + + " \"description\": \"a9DEa0kpY\",\n" + + " \"instance-group-type\": \"type\",\n" + + " \"resource-version\": \"1520886467989\",\n" + + " \"instance-group-name\": \"wKmBXiO1xm8bK\",\n" + + " \"instance-group-function\": \"testfunction2\",\n" + + " \"relationship-list\": {\n" + + " \"relationship\": [\n" + + " {\n" + + " \"related-to\": \"cloud-region\",\n" + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + + " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\n" + + " \"relationship-data\": [\n" + + " {\n" + + " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + + " \"relationship-value\": \"AAI-12002-vm230w\"\n" + + " },\n" + + " {\n" + + " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + + " \"relationship-value\": \"AAI-region-vm230w\"\n" + + " }\n" + + " ],\n" + + " \"related-to-property\": [\n" + + " {\n" + + " \"property-key\": \"cloud-region.owner-defined-type\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"instance-group\": {\n" + + " \"instance-group-role\": \"JZmha7QSS4tJ\",\n" + + " \"model-invariant-id\": \"model-id2\",\n" + + " \"model-version-id\": \"version2\",\n" + + " \"id\": \"AAI-12002-test2-vm230w\",\n" + + " \"description\": \"a9DEa0kpY\",\n" + + " \"instance-group-type\": \"type\",\n" + + " \"resource-version\": \"1520888629970\",\n" + + " \"instance-group-name\": \"wKmBXiO1xm8bK\",\n" + + " \"instance-group-function\": \"testfunction2\",\n" + + " \"relationship-list\": {\n" + + " \"relationship\": [\n" + + " {\n" + + " \"related-to\": \"cloud-region\",\n" + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" + + " \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\n" + + " \"relationship-data\": [\n" + + " {\n" + + " \"relationship-key\": \"cloud-region.cloud-owner\",\n" + + " \"relationship-value\": \"AAI-12002-vm230w\"\n" + + " },\n" + + " {\n" + + " \"relationship-key\": \"cloud-region.cloud-region-id\",\n" + + " \"relationship-value\": \"AAI-region-vm230w\"\n" + + " }\n" + + " ],\n" + + " \"related-to-property\": [\n" + + " {\n" + + " \"property-key\": \"cloud-region.owner-defined-type\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " }\n" + + " }\n" + + " ]\n" + + "}\n"; + } + +} |