diff options
author | 2018-08-13 12:04:07 +0200 | |
---|---|---|
committer | 2018-08-13 12:06:02 +0200 | |
commit | 5ac1100c02912f7a45d2949d94cd33d054283139 (patch) | |
tree | 162e996dcaa5dd1e7db73ce3d0ac8adca08d8233 /vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java | |
parent | ccfb3ba1fbeb9f2807fa498686ce4441ac5cfc21 (diff) |
Renaming vid-automation #1
Change-Id: Ib5b576a931e37930119e440e965e491b1711d073
Issue-ID: VID-205
Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java')
-rw-r--r-- | vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java new file mode 100644 index 00000000..e098a576 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIPostNamedQueryForViewEdit.java @@ -0,0 +1,100 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +public class PresetAAIPostNamedQueryForViewEdit extends BaseAAIPreset { + + private final String serviceInstanceId; + private final boolean hasConfigurationInstance; + + public PresetAAIPostNamedQueryForViewEdit(String serviceInstanceId) { + this(serviceInstanceId, true); + } + + public PresetAAIPostNamedQueryForViewEdit(String serviceInstanceId, boolean hasConfigurationInstance) { + this.serviceInstanceId = serviceInstanceId; + this.hasConfigurationInstance = hasConfigurationInstance; + } + + // inspired by + // registration_to_simulator/search_for_service_instance/aai_named_query_for_view_edit_test_sssdad.json + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return "/aai/search/named-query"; + } + + @Override + public Object getRequestBody() { + return "" + + "{" + + " \"instance-filters\": {" + + " \"instance-filter\": [{" + + " \"customer\": {" + + " \"global-customer-id\": \"e433710f-9217-458d-a79d-1c7aff376d89\"" + + " }," + + " \"service-instance\": {" + + //" \"service-instance-id\": \"c187e9fe-40c3-4862-b73e-84ff056205f6\"" + + " \"service-instance-id\": \"" + serviceInstanceId + "\"" + + " }," + + " \"service-subscription\": {" + + " \"service-type\": \"VIRTUAL USP\"" + + " }" + + " }" + + " ]" + + " }," + + " \"query-parameters\": {" + + " \"named-query\": {" + + " \"named-query-uuid\": \"0367193e-c785-4d5f-9cb8-7bc89dc9ddb7\"" + + " }" + + " }" + + "}"; + } + + @Override + public Object getResponseBody() { + String response = + "{" + + " \"inventory-response-item\": [{" + + " \"model-name\": \"0eOHz2Yh8WJcBYzKy079\"," + + " \"service-instance\": {" + + " \"service-instance-id\": \"" + serviceInstanceId + "\"," + + " \"service-instance-name\": \"test_sssdad\"" + + " }," + + " \"extra-properties\": {}"; + if(hasConfigurationInstance) { + response += "," + + " \"inventory-response-items\": {" + + " \"inventory-response-item\": [{" + + " \"model-name\": \"Proxy-Config-Instance\"," + + " \"configuration\": {" + + " \"configuration-id\": \"9533-config-LB1113\"," + + " \"configuration-name\": \"dummy_instance\"," + + " \"configuration-type\": \"configuration-type-9533\"," + + " \"configuration-sub-type\": \"configuration-sub-type-9533\"," + + " \"model-invariant-id\": \"model-invariant-id-9533\"," + + " \"model-version-id\": \"model-version-id-9533\"," + + //" \"orchestration-status\": \"<ORCH_STATUS>\"," + + " \"orchestration-status\": \"Active\"," + + " \"operational-status\": \"\"," + + " \"configuration-selflink\": \"\"," + + " \"model-customization-id\": \"08a181aa-72eb-435f-9593-e88a3ad0a86b\"," + + " \"resource-version\": \"1504038855716\"" + + " }," + + " \"extra-properties\": {}" + + " }" + + " ]" + + " }"; + } + response += " }" + + " ]" + + "}"; + return response; + } +} |