summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers
diff options
context:
space:
mode:
authorr.bogacki <r.bogacki@samsung.com>2019-03-25 14:15:00 +0100
committerr.bogacki <r.bogacki@samsung.com>2019-03-25 14:15:29 +0100
commite79de3f870806ce40c541ca9fc5d9489fef31d25 (patch)
tree568308915a77eb14ccfbca1a80c8740dcf968ca6 /mso-api-handlers
parent7815bcec2a85b023f3004e698712cea7fed2f94e (diff)
JUnit tests for CamundaClient
Increased junit tests coverage according to Sonar analyses. Change-Id: I52b13399c03bae4efbb0a5a7daf8eb9fde40d244 Issue-ID: SO-1692 Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
Diffstat (limited to 'mso-api-handlers')
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
index 0958905720..edab3b07b6 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -189,5 +190,22 @@ public class CamundaClientTest{
}
+ @Test
+ public void testPostWithRequestClientParameter() throws Exception {
+ CamundaClient testClient = new CamundaClient();
+ String orchestrationURI = "/engine-rest/process-definition/key/dummy/start";
+ HttpResponse mockResponse = createResponse(200, "{}");
+ mockHttpClient = Mockito.mock(HttpClient.class);
+ Mockito.when(mockHttpClient.execute(Mockito.any(HttpPost.class))).thenReturn(mockResponse);
+
+ testClient.setClient(mockHttpClient);
+ testClient.setUrl(orchestrationURI);
+
+ HttpResponse response = testClient.post(new RequestClientParameter.Builder().build());
+
+ assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+
+ }
+
}