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/mso/PresetMSODeleteInstanceOrchestrationRequestGet.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/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java')
-rw-r--r-- | vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java new file mode 100644 index 000000000..7d222e6e5 --- /dev/null +++ b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/mso/PresetMSODeleteInstanceOrchestrationRequestGet.java @@ -0,0 +1,64 @@ +package org.opencomp.simulator.presetGenerator.presets.mso; + +import org.opencomp.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSODeleteInstanceOrchestrationRequestGet extends BaseMSOPreset { + + private final static String DEFAULT_REQUEST_ID = "c0011670-0e1a-4b74-945d-8bf5aede1d9c"; + private final String requestId; + private final String requestScope; + String requestState; + + public PresetMSODeleteInstanceOrchestrationRequestGet() { + this("Service"); + } + + public PresetMSODeleteInstanceOrchestrationRequestGet(String requestScope) { + this(requestScope, "COMPLETE"); + } + + public PresetMSODeleteInstanceOrchestrationRequestGet(String requestScope, String requestState) { + this.requestScope = requestScope; + this.requestState = requestState; + this.requestId = DEFAULT_REQUEST_ID; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + public String getReqPath() { + return getRootPath() + "/orchestrationRequests/v5/" + requestId; + } + + @Override + public Object getResponseBody() { + return "{" + + " \"request\": {" + + " \"requestId\": \"" + requestId + "\"," + + " \"startTime\": \"Mon, 11 Dec 2017 07:27:49 GMT\"," + + " \"requestScope\": \"" + this.requestScope.toLowerCase() + "\"," + + " \"requestType\": \"deleteInstance\"," + + " \"instanceReferences\": {" + + " \"serviceInstanceId\": \"f8791436-8d55-4fde-b4d5-72dd2cf13cfb\"," + + " \"serviceInstanceName\": \"asdfasdf234234asdf\"," + + " \"requestorId\": \"il883e\"" + + " }," + + " \"requestStatus\": {" + + " \"requestState\": \"" + requestState + "\"," + + " \"statusMessage\": \"" + getStatusMessage() + "\"," + + " \"percentProgress\": 100," + + " \"finishTime\": \"Mon, 11 Dec 2017 07:27:53 GMT\"" + + " }" + + " }" + + "}"; + } + + private String getStatusMessage() { + return "COMPLETE".equals(requestState) ? + this.requestScope + " has been deleted successfully." : + (this.requestScope + " has been " + requestState.toLowerCase() + " successfully."); + } +} |