Add test for SimpleHttpClient and https
This commit is contained in:
parent
0ed91721b0
commit
fb177d8a76
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue