blob: 7f00c6b9af4c4887076107751070612021712546 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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());
}
}
|