diff options
author | Steve Smokowski <ss835w@att.com> | 2019-03-25 20:47:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-25 20:47:29 +0000 |
commit | af46c0d4b30ecb5c8f36992e74adb86d7d5bbe06 (patch) | |
tree | e3d723b88495b5923f05da9e80643c40d28f7cdc | |
parent | 448899ee55a6cf1c55b5510adceba8b3bab98297 (diff) | |
parent | e79de3f870806ce40c541ca9fc5d9489fef31d25 (diff) |
Merge "JUnit tests for CamundaClient"
-rw-r--r-- | mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java | 18 |
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()); + + } + } |