diff options
author | 2018-08-12 14:51:28 +0300 | |
---|---|---|
committer | 2018-08-12 15:02:57 +0300 | |
commit | 4a4dcc5185f8ba5a28c7f9fef509f32c0c2389e6 (patch) | |
tree | 23e55ee7e1ad9b91bcc3ef1dbe1fb7b183f8b2b6 /vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc | |
parent | 661a24fd57de02869a9771761e0fcba7eb77d121 (diff) |
vid-automation selenium tests
Change-Id: I6c1b0a0cf3bbfa4314c81f0cc72507db805ec632
Issue-ID: VID-281
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc')
3 files changed, 102 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceMetadataGet.java b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceMetadataGet.java new file mode 100644 index 00000000..7ec6e0e2 --- /dev/null +++ b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceMetadataGet.java @@ -0,0 +1,50 @@ +package org.opencomp.simulator.presetGenerator.presets.sdc; + +import org.springframework.http.HttpMethod; + +/** + * Created by itzikliderman on 21/12/2017. + */ +public class PresetSDCGetServiceMetadataGet extends SdcPresetWithModelVersionId { + + public PresetSDCGetServiceMetadataGet(String modelVersionId, String modelInvariantId, String zipFileName) { + super(modelVersionId); + this.modelInvariantId = modelInvariantId; + this.zipFileName = zipFileName; + } + + private final String zipFileName; + private final String modelInvariantId; + + + @Override + public Object getResponseBody() { + return "{" + + " \"uuid\": \""+getModelVersionId()+"\"," + + " \"invariantUUID\": \""+getModelInvariantId()+"\"," + + " \"name\": \"action-data\"," + + " \"version\": \"1.0\"," + + " \"toscaModelURL\": \"./"+zipFileName+"\"," + + " \"category\": \"Mobility\"," + + " \"lifecycleState\": \"CERTIFIED\"," + + " \"lastUpdaterUserId\": \"rg276b\"," + + " \"lastUpdaterFullName\": null," + + " \"distributionStatus\": \"DISTRIBUTED\"," + + " \"artifacts\": null," + + " \"resources\": null" + + " }"; + } + + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return super.getReqPath()+"/metadata"; + } + + public String getModelInvariantId() { + return modelInvariantId; + } +} diff --git a/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGet.java b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGet.java new file mode 100644 index 00000000..cb227682 --- /dev/null +++ b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/PresetSDCGetServiceToscaModelGet.java @@ -0,0 +1,30 @@ +package org.opencomp.simulator.presetGenerator.presets.sdc; + +import org.springframework.http.HttpMethod; + +/** + * Created by itzikliderman on 21/12/2017. + */ +public class PresetSDCGetServiceToscaModelGet extends SdcPresetWithModelVersionId { + + private String file; + + public PresetSDCGetServiceToscaModelGet(String modelVersionId, String file) { + super(modelVersionId); + this.file = file; + } + + public HttpMethod getReqMethod() { + return HttpMethod.GET; + } + + @Override + public String getReqPath() { + return super.getReqPath()+"/toscaModel"; + } + + @Override + public String getFile() { + return file; + } +} diff --git a/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/SdcPresetWithModelVersionId.java b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/SdcPresetWithModelVersionId.java new file mode 100644 index 00000000..e8fdfa2b --- /dev/null +++ b/vid-automation/src/main/java/org/opencomp/simulator/presetGenerator/presets/sdc/SdcPresetWithModelVersionId.java @@ -0,0 +1,22 @@ +package org.opencomp.simulator.presetGenerator.presets.sdc; + +import org.opencomp.simulator.presetGenerator.presets.BasePresets.BaseSDCPreset; + +public abstract class SdcPresetWithModelVersionId extends BaseSDCPreset { + + public SdcPresetWithModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } + + protected String modelVersionId; + + public String getModelVersionId() { + return modelVersionId; + } + + public String getReqPath() { + return getRootPath() + "/"+getModelVersionId(); + } + + +} |