diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-03-11 09:34:34 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-03-17 17:02:43 +0200 |
commit | 66af8b9b391879be78660d6ccb0a1f1f9340b423 (patch) | |
tree | fc0d510f7ea28a437bcb1e3b950d1281ac88a4e4 /vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java | |
parent | 37ad0cc1d36ec6ff68ec39fcaaf2617eef7d08fe (diff) |
Merge automation from ECOMP's repository
Reference commit in ECOMP: 8e92a8c6
Issue-ID: VID-378
Change-Id: Ia32f4813378ef95097f788246aa5b1172e20ca48
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java')
-rw-r--r-- | vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java new file mode 100644 index 000000000..92d45bf5b --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOActivateFabricConfigurationErrorResponse.java @@ -0,0 +1,62 @@ +package org.onap.simulator.presetGenerator.presets.mso; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; +import org.springframework.http.HttpMethod; + +public class PresetMSOActivateFabricConfigurationErrorResponse extends BaseMSOPreset { + private final String serviceInstanceId; + private final int errorCode; + public static final String DEFAULT_SERVICE_INSTANCE_ID = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d"; + + public PresetMSOActivateFabricConfigurationErrorResponse() { + this(null, 0); + } + + public PresetMSOActivateFabricConfigurationErrorResponse(String serviceInstanceId) { + this(serviceInstanceId, 0); + } + + public PresetMSOActivateFabricConfigurationErrorResponse(String serviceInstanceId, int errorCode) { + this.serviceInstanceId = serviceInstanceId != null ? serviceInstanceId : DEFAULT_SERVICE_INSTANCE_ID; + this.errorCode = errorCode > 0 ? errorCode : 500; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.POST; + } + + @Override + public String getReqPath() { + return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/activateFabricConfiguration"; + } + + @Override + public String getRequestBody() { + return "{" + + " \"requestDetails\": {" + + " \"modelInfo\": {" + + " \"modelType\": \"service\"" + + " }," + + " \"cloudConfiguration\": {" + + " }," + + " \"requestInfo\": {" + + " \"source\": \"VID\"" + + " }," + + " \"requestParameters\": {" + + " \"aLaCarte\": false" + + " }" + + " }" + + "}"; + } + + @Override + public Object getResponseBody() { + return "{\"error\":\"222\",\"message\":\"error message\"}"; + } + + @Override + public int getResponseCode() { + return errorCode; + } +} |