summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/test
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2019-04-09 23:18:19 -0700
committerEric Multanen <eric.w.multanen@intel.com>2019-04-11 07:42:10 -0700
commit287362502adc4485fc43f9364fd1829adec55ab6 (patch)
treeefb6a89c192b5c205a943ead9e81cc6ba5fd1608 /adapters/mso-openstack-adapters/src/test
parentae01b62624eb897ee1d556110bf2dd189335abc0 (diff)
Update multicloud plugin GET handling
Supports multicloud API query by workload name or id. Gets workload details e.g. stack outputs, etc. To be used to fill in inputs for vfmodule that has a volume group or base module. Change-Id: If45783e82c2a209d3385be1b689a02a05baf9922 Issue-ID: SO-1445 Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java5
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/__files/MulticloudGetStackExists.json34
2 files changed, 37 insertions, 2 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
index 9d13cc10a3..5f2057524f 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
@@ -24,6 +24,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -138,9 +139,9 @@ public class MsoVnfMulticloudAdapterImplTest extends BaseRestTestUtils {
msoRequest.setServiceInstanceId("12345");
wireMockServer.stubFor(
- get(urlPathEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload/vfname")).willReturn(aResponse()
+ get(urlEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload?name=vfname")).willReturn(aResponse()
// .withHeader()
- .withBodyFile("MulticloudResponse_Stack.json").withStatus(HttpStatus.SC_OK)));
+ .withBodyFile("MulticloudGetStackExists.json").withStatus(HttpStatus.SC_OK)));
try {
instance.createVfModule("MTN13", "CloudOwner", "123", "vf", "v1", "genericVnfId", "vfname", "vfModuleId",
diff --git a/adapters/mso-openstack-adapters/src/test/resources/__files/MulticloudGetStackExists.json b/adapters/mso-openstack-adapters/src/test/resources/__files/MulticloudGetStackExists.json
new file mode 100644
index 0000000000..41a9959812
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/test/resources/__files/MulticloudGetStackExists.json
@@ -0,0 +1,34 @@
+{
+ "template_type": "heat",
+ "workload_id": "vfname",
+ "workload_status": "GET_COMPLETE",
+ "workload_status_reason": {
+ "stacks": [
+ {
+ "id": "vfname",
+ "links" : [
+ {
+ "href" : "port",
+ "rel" : "self"
+ }
+ ],
+ "stack_name": "vfname",
+ "stack_status": "CREATE_COMPLETE",
+ "creation_time": "2019-03-21T03:17:32Z",
+ "description": "Sample stack response",
+ "stack_owner": "stack_Owner",
+ "capabilities": [],
+ "parameters": {
+ "OS::project_id": "0e148b76ee8c42f78d37013bf6b7b1ae",
+ "apt_proxy": "10.12.5.2:8000",
+ "etcd_vm_flavor": "m1.medium",
+ "docker_version": "17.03.2",
+ "portal_hostname": "portal.api.simpledemo.onap.org",
+ "docker_proxy": "10.12.5.2:5000",
+ "kubectl_version": "1.11.5",
+ "use_ramdisk": "false"
+ }
+ }
+ ]
+ }
+}