summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test
diff options
context:
space:
mode:
authorModaboina, Kusumakumari (km583p) <km583p@us.att.com>2018-06-19 16:05:35 -0400
committerTakamune Cho <tc012c@att.com>2018-06-21 15:10:43 +0000
commit4967bfac5cddc1407a4848e0b9cb9ff219706360 (patch)
treec5492606e254c2b185ee7d4cbcf811aa4512fc0a /appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test
parent3d38c97e8e0ae3a2fda18cba4dcbae442901b7d8 (diff)
chef adapter changes for pushjob status nodescheck
Issue-ID: APPC-1012 Change-Id: Iac03825b092f62a8d3747a62303f7869bc8280e8 Signed-off-by: Modaboina, Kusumakumari (km583p) <km583p@us.att.com>
Diffstat (limited to 'appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test')
-rw-r--r--appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/impl/ChefAdapterImplJobPusherTest.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/impl/ChefAdapterImplJobPusherTest.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/impl/ChefAdapterImplJobPusherTest.java
index 9e83dd63d..f489ad5a4 100644
--- a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/impl/ChefAdapterImplJobPusherTest.java
+++ b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/impl/ChefAdapterImplJobPusherTest.java
@@ -180,14 +180,27 @@ public class ChefAdapterImplJobPusherTest {
public void checkPushJob_shouldCheckJobStatusOnlyOnce_withoutAdditionalRetries_whenFirstReturnedJobStatusIs_Complete()
throws SvcLogicException {
String expectedHttpStatus = Integer.toString(HttpStatus.SC_OK);
- String expectedMessage = "{status:complete}";
-
+ //String expectedMessage = "{status:complete}";
+ String expectedMessage = "{\"nodes\":{\"succeeded\":[\"NODE1.atttest.com\"]},\"id\":\"26d\",\"command\":\"chef-client\",\"status\":\"complete\"} ";
assertCheckJobStatusFor(
expectedHttpStatus,
expectedMessage,
- ChefResponse.create(HttpStatus.SC_OK, "{status:complete}"),
+ ChefResponse.create(HttpStatus.SC_OK, expectedMessage),
ChefResponse.create(HttpStatus.SC_OK, "{status:running}"));
}
+ @Test
+ public void checkPushJob_withFailedNode_whenFirstReturnedJobStatusIs_Complete()
+ throws SvcLogicException {
+ String expectedHttpStatus = "401";
+ String message = "{\"nodes\":{\"failed\":[\"NODE1.atttest.com\"]},\"id\":\"26d\",\"command\":\"chef-client\",\"status\":\"complete\"} ";
+ String expectedMessage = "PushJob Status Complete but check failed nodes in the message :"+ message ;
+
+ assertCheckJobStatusFor(
+ expectedHttpStatus,
+ expectedMessage,
+ ChefResponse.create(HttpStatus.SC_OK, message));
+ }
+
@Test
public void checkPushJob_shouldCheckJobStatusExpectedNumberOf_ThreeRetryTimes_whenEachReturnedStatusIs_Running()