diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2019-11-20 16:16:41 +0200 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2019-11-20 22:54:53 +0200 |
commit | b099e7945b134d78ea50f986bdb4b4a3b2d9281a (patch) | |
tree | aeb2aa92360e830c3e619bf3b78f3d40898ec9fd /vid-automation/src/main/java/org | |
parent | 6225ebb29254ca6381ce91a3e0553f592b2fbc40 (diff) |
a-la-carte services e2e test - add more 2 VfModules
Issue-ID: VID-701
Change-Id: I644ff412d1bff60842793e3839f66bf5007cb32b
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-automation/src/main/java/org')
3 files changed, 34 insertions, 18 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java index ace17888f..2a353a38b 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteCypress.java @@ -32,7 +32,7 @@ public class PresetMSOCreateVfModuleALaCarteCypress extends PresetMSOCreateVfMod .build(); public PresetMSOCreateVfModuleALaCarteCypress(String overrideRequestId, String serviceInstanceId, String vnfInstanceId, Map<Keys, String> names, String testApi, boolean withTestApi) { - super(overrideRequestId, serviceInstanceId, vnfInstanceId); + super(overrideRequestId, DEFAULT_INSTANCE_ID, serviceInstanceId, vnfInstanceId, "vfModule"); this.names = names; this.msoTestApi = testApi; this.withTestApi = withTestApi; diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java index 57d15bd40..89744a723 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleALaCarteE2E.java @@ -1,42 +1,47 @@ package org.onap.simulator.presetGenerator.presets.mso; +import org.apache.commons.lang3.ObjectUtils; import vid.automation.test.infra.ModelInfo; +import vid.automation.test.infra.ModelInfoWithCustomization; public class PresetMSOCreateVfModuleALaCarteE2E extends PresetMSOCreateVfModuleBase { protected final String requestorId; protected final ModelInfo serviceModelInfo; + private final String instanceName; + private final ModelInfoWithCustomization resourceModelInfo; + private final String relatedInstance; public PresetMSOCreateVfModuleALaCarteE2E( String overrideRequestId, + String responseInstanceId, String serviceInstanceId, String vnfInstanceId, String requestorId, - ModelInfo serviceModelInfo) { - super(overrideRequestId, serviceInstanceId, vnfInstanceId); - this.requestorId = requestorId; - this.serviceModelInfo = serviceModelInfo; + ModelInfo serviceModelInfo, + String instanceName, + ModelInfoWithCustomization resourceModelInfo, + String relatedInstance) { + super(overrideRequestId, responseInstanceId, serviceInstanceId, vnfInstanceId, resourceModelInfo.resourceType); + this.requestorId = requestorId; + this.serviceModelInfo = serviceModelInfo; + this.instanceName = instanceName; + this.resourceModelInfo = resourceModelInfo; + this.relatedInstance = relatedInstance; } @Override public Object getRequestBody() { return "{" + " \"requestDetails\": {" - + " \"modelInfo\": {" - + " \"modelCustomizationName\": \"Vocg1804Vf..base_ocg..module-0\"," - + " \"modelCustomizationId\": \"a7b333d7-7633-4197-b40d-80fcfcadee94\"," - + " \"modelInvariantId\": \"e9c795c8-6b98-4db3-bd90-a84b8ca5181b\"," - + " \"modelVersionId\": \"815db6e5-bdfd-4cb6-9575-82c36df8747a\"," - + " \"modelName\": \"Vocg1804Vf..base_ocg..module-0\"," - + " \"modelType\": \"vfModule\"," - + " \"modelVersion\": \"4\"" - + " }," + + resourceModelInfo.createMsoModelInfo() + " \"cloudConfiguration\": {" + " \"lcpCloudRegionId\": \"hvf6\"," + addCloudOwnerIfNeeded() + " \"tenantId\": \"bae71557c5bb4d5aac6743a4e5f1d054\"" + " }," + " \"requestInfo\": {" + + addInstanceName() + " \"source\": \"VID\"," + " \"suppressRollback\": false," + " \"requestorId\": \""+requestorId+"\"" @@ -59,7 +64,7 @@ public class PresetMSOCreateVfModuleALaCarteE2E extends PresetMSOCreateVfModuleB + " }," + " \"instanceId\": \""+vnfInstanceId+"\"" + " }" - + " }" + + " }" + addRelatedInstance() + " ]," + " \"requestParameters\": {" + " \"userParams\": [{" @@ -72,4 +77,13 @@ public class PresetMSOCreateVfModuleALaCarteE2E extends PresetMSOCreateVfModuleB + " }" + "}"; } + + private String addInstanceName() { + return instanceName==null ? "" : + "\"instanceName\": \""+instanceName+"\","; + } + + private String addRelatedInstance() { + return ObjectUtils.defaultIfNull(relatedInstance, ""); + } } diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java index 344f43cdd..7c148fa08 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVfModuleBase.java @@ -2,13 +2,15 @@ package org.onap.simulator.presetGenerator.presets.mso; public class PresetMSOCreateVfModuleBase extends PresetMSOBaseCreateInstancePost { + private final String resourceType; protected String serviceInstanceId; protected String vnfInstanceId; - public PresetMSOCreateVfModuleBase(String requestId, String serviceInstanceId, String vnfInstanceId) { - super(requestId); + public PresetMSOCreateVfModuleBase(String requestId, String responseInstanceId, String serviceInstanceId, String vnfInstanceId, String resourceType) { + super(requestId, responseInstanceId); this.serviceInstanceId = serviceInstanceId; this.vnfInstanceId = vnfInstanceId; + this.resourceType = resourceType; } @Override @@ -18,6 +20,6 @@ public class PresetMSOCreateVfModuleBase extends PresetMSOBaseCreateInstancePost @Override public String getReqPath() { - return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId + "/vfModules"; + return getRootPath() + String.format("/serviceInstantiation/v./serviceInstances/%s/vnfs/%s/%ss",serviceInstanceId, vnfInstanceId, resourceType); } } |