aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-building-blocks/src/test
diff options
context:
space:
mode:
authorElena Kuleshov <EK1439@att.com>2018-09-19 14:07:11 -0400
committerElena Kuleshov <EK1439@att.com>2018-09-19 14:09:21 -0400
commit3732da89dda106bcf4d59c428737b67be42d7022 (patch)
treecb1be799be711b336d7d20b2317f87214361dc31 /bpmn/so-bpmn-building-blocks/src/test
parentc18addf7b6fb56a55b0ecfd5030c43308c46186d (diff)
Deployment script for Activities
Deployment script for activities to WorkflowDesigner and activities specs. Change-Id: I7474805ccf5c8ab0e0a7a43b785de02a29649e2e Issue-ID: SO-840 Signed-off-by: Elena Kuleshov <EK1439@att.com>
Diffstat (limited to 'bpmn/so-bpmn-building-blocks/src/test')
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java62
1 files changed, 62 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java
new file mode 100644
index 0000000000..77146593ba
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/activity/DeployActivitySpecsTest.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.activity;
+
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.ProtocolVersion;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.message.BasicHttpResponse;
+import org.junit.Test;
+
+public class DeployActivitySpecsTest {
+ private static final String RESULT_STRING = "HTTP/1.1 404 ";
+ private static final String HOSTNAME = "http://localhost:8080";
+
+ @Test
+ public void DeployActivitySpecsMain_Test() throws Exception {
+ ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1);
+ HttpResponse response = new BasicHttpResponse(protocolVersion, 1, "");
+ response.setStatusCode(404);
+ response.setStatusLine(protocolVersion, 1, "");
+ HttpClient clientMock = mock(HttpClient.class);
+ when(clientMock.execute(any(HttpPost.class))).thenReturn(response);
+ String[] args = new String[] {HOSTNAME};
+ DeployActivitySpecs.main(args);
+ }
+
+ @Test
+ public void DeployActivitySpec_Test() throws Exception {
+ ProtocolVersion protocolVersion = new ProtocolVersion("", 1, 1);
+ HttpResponse response = new BasicHttpResponse(protocolVersion, 1, "");
+ response.setStatusCode(404);
+ response.setStatusLine(protocolVersion, 1, "");
+ HttpClient clientMock = mock(HttpClient.class);
+ when(clientMock.execute(any(HttpPost.class))).thenReturn(response); ;
+ String result = DeployActivitySpecs.deployActivitySpec(HOSTNAME, "VNFQuiesceTrafficActivitySpec.json");
+ assertEquals(result, RESULT_STRING);
+ }
+}