Add test for SimpleHttpClient and https

This commit is contained in:
dotasek 2022-01-20 13:44:03 -05:00
parent 0ed91721b0
commit fb177d8a76
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package org.hl7.fhir.utilities;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class SimpleHTTPClientTest {
@Test
public void testSimpleHTTPClient() throws IOException {
SimpleHTTPClient http = new SimpleHTTPClient();
String url = "https://hl7.org/fhir/us/core/package-list.json?nocache=" + System.currentTimeMillis();
SimpleHTTPClient.HTTPResult res = http.get(url, "application/json");
System.out.println(res.getCode());
System.out.println(new String(res.getContent(), StandardCharsets.UTF_8));
assertTrue(res.getCode() != 400);
}
}