summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShadi Haidar <sh1986@att.com>2018-09-07 22:05:43 -0400
committerShadi Haidar <sh1986@att.com>2018-09-12 13:58:04 -0400
commitceda84d021dde70299f96984ca7aec16740854be (patch)
tree967b1c37a9e21721240d68e9b81dc59a0a593512 /tests
parent8ca8ddf40decb543e5ea634e29efe6972272a2f6 (diff)
Check deployment creation before install
Unit Test Code Coverage: Statements : 76.85% ( 893/1162 ) Branches : 52.99% ( 275/519 ) Functions : 78.68% ( 155/197 ) Lines : 77.21% ( 884/1145 ) Issue-ID: DCAEGEN2-754 Change-Id: Id8f3fa26e8ece7e9099145ea20034829a1ad7d13 Signed-off-by: Shadi Haidar <sh1986@att.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dcae-deployments.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_dcae-deployments.js b/tests/test_dcae-deployments.js
index a010017..ca64d94 100644
--- a/tests/test_dcae-deployments.js
+++ b/tests/test_dcae-deployments.js
@@ -174,6 +174,23 @@ const Cloudify = {
"blueprint_id": blueprint_id || deployment_id
};
},
+ resp_dep_creation: function(deployment_id) {
+ return {
+ "items": [
+ {
+ "status": "terminated",
+ "id": "ee6b0d21-0257-46a3-bb83-6f61f9ab5f99"
+ }
+ ],
+ "metadata": {
+ "pagination": {
+ "total": 1,
+ "offset": 0,
+ "size": 10000
+ }
+ }
+ };
+ },
resp_execution: function(deployment_id, blueprint_id, execution_id, terminated, workflow_id) {
return {
"status": (terminated && "terminated") || "pending",
@@ -406,6 +423,12 @@ function test_put_dcae_deployments_success(dh_server) {
return JSON.stringify(Cloudify.resp_deploy(DEPLOYMENT_ID_JFL_1, DEPLOYMENT_ID_JFL_1, message.inputs));
});
+ nock(dh.CLOUDIFY_URL).get("/api/v2.1/executions?deployment_id=" + DEPLOYMENT_ID_JFL_1 + "&workflow_id=create_deployment_environment&_include=id,status")
+ .reply(200, function(uri) {
+ console.log(action_timer.step, "get", dh.CLOUDIFY_URL, uri);
+ return JSON.stringify(Cloudify.resp_dep_creation(DEPLOYMENT_ID_JFL_1));
+ });
+
nock(dh.CLOUDIFY_URL).post("/api/v2.1/executions")
.reply(201, function(uri, requestBody) {
console.log(action_timer.step, "post", dh.CLOUDIFY_URL, uri, JSON.stringify(requestBody));