summaryrefslogtreecommitdiffstats
path: root/ms/generic-resource-api/src/test
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2020-11-18 15:01:50 -0500
committerDan Timoney <dtimoney@att.com>2020-11-18 15:01:50 -0500
commitcdbee91b722e25728fca0af32cf6a55d5be50c2e (patch)
tree258317703e3b1c7a4ed630610b8a3d9dda8d6c73 /ms/generic-resource-api/src/test
parent192f1cb5b022e00baba3d60bbae389c26fcaf1da (diff)
Add integration test for GR-API docker container
Add integration test for GR-API docker container Change-Id: Iebd60f56668c9b50a2aab62b5309c609bc2369ce Issue-ID: SDNC-1417 Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'ms/generic-resource-api/src/test')
-rw-r--r--ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsIT.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsIT.java b/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsIT.java
new file mode 100644
index 0000000..7f00c6b
--- /dev/null
+++ b/ms/generic-resource-api/src/test/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsIT.java
@@ -0,0 +1,31 @@
+package org.onap.sdnc.apps.ms.gra;
+
+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 GenericResourceMsIT {
+ @Test
+ public void healthcheckTest() throws ClientProtocolException, IOException {
+ String graPort = System.getenv("GRA_PORT");
+ if ((graPort == null) || (graPort.length() == 0)) {
+ graPort = "8080";
+ }
+
+ String testUrl = "http://localhost:" + graPort + "/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());
+ }
+}