1 package org.onap.ccsdk.apps.ms.sliboot;
3 import static org.junit.jupiter.api.Assertions.assertEquals;
5 import java.io.IOException;
7 import org.apache.http.client.ClientProtocolException;
8 import org.apache.http.client.methods.CloseableHttpResponse;
9 import org.apache.http.client.methods.HttpPost;
10 import org.apache.http.impl.client.CloseableHttpClient;
11 import org.apache.http.impl.client.HttpClients;
12 import org.junit.Test;
14 public class SlibootIT {
16 public void healthcheckTest() throws ClientProtocolException, IOException {
17 String slibootPort = System.getenv("SLIBOOT_PORT");
18 if ((slibootPort == null) || (slibootPort.length() == 0)) {
22 String testUrl = "http://localhost:" + slibootPort + "/restconf/operations/SLI-API:healthcheck/";
24 CloseableHttpClient client = HttpClients.createDefault();
25 HttpPost postCmd = new HttpPost(testUrl);
26 postCmd.addHeader("Content-Type", "application/json");
28 CloseableHttpResponse resp = client.execute(postCmd);
29 assertEquals(200, resp.getStatusLine().getStatusCode());