aboutsummaryrefslogtreecommitdiffstats
path: root/ms/sliboot/src/test/java
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2020-11-16 14:58:31 -0500
committerDan Timoney <dtimoney@att.com>2020-11-17 15:26:50 -0500
commitb84d399884ed03d3144903ee558933ed8fb800f7 (patch)
tree2411620bc2743b0d18738759b4b8a13bd5bed236 /ms/sliboot/src/test/java
parent42624f16cadb0e6bf1c4f9317c4c287a274a1c89 (diff)
Add integration test for sliboot docker
Added integration test for sliboot docker. Change-Id: I582d41ac1a041466e16bd0f38ef3b9ccfef4747a Issue-ID: CCSDK-2986 Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'ms/sliboot/src/test/java')
-rw-r--r--ms/sliboot/src/test/java/org/onap/ccsdk/apps/ms/sliboot/SlibootIT.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/ms/sliboot/src/test/java/org/onap/ccsdk/apps/ms/sliboot/SlibootIT.java b/ms/sliboot/src/test/java/org/onap/ccsdk/apps/ms/sliboot/SlibootIT.java
new file mode 100644
index 00000000..9fce09dc
--- /dev/null
+++ b/ms/sliboot/src/test/java/org/onap/ccsdk/apps/ms/sliboot/SlibootIT.java
@@ -0,0 +1,31 @@
+package org.onap.ccsdk.apps.ms.sliboot;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.IOException;
+
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.junit.Test;
+
+public class SlibootIT {
+ @Test
+ public void healthcheckTest() throws ClientProtocolException, IOException {
+ String slibootPort = System.getenv("SLIBOOT_PORT");
+ if ((slibootPort == null) || (slibootPort.length() == 0)) {
+ slibootPort = "8080";
+ }
+
+ String testUrl = "http://localhost:" + slibootPort + "/restconf/operations/SLI-API:healthcheck/";
+
+ CloseableHttpClient client = HttpClients.createDefault();
+ HttpPost postCmd = new HttpPost(testUrl);
+ postCmd.addHeader("Content-Type", "application/json");
+
+ CloseableHttpResponse resp = client.execute(postCmd);
+ assertEquals(200, resp.getStatusLine().getStatusCode());
+ }
+}