summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test
diff options
context:
space:
mode:
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()