Skip to content

Commit d6359e1

Browse files
authored
Merge pull request #774 from jschneid-nmdp/use-uri-constructor
use URI constructor instead of string concatenation
2 parents cc6b71d + e7cc34d commit d6359e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
import java.io.IOException;
4343
import java.net.URI;
44+
import java.net.URISyntaxException;
4445
import java.util.ArrayList;
4546
import java.util.List;
4647
import java.util.concurrent.TimeUnit;
@@ -315,10 +316,10 @@ private int activeSubscriptionCount() {
315316

316317
@ParameterizedTest
317318
@ValueSource(strings = {"prometheus", "health", "metrics", "info"})
318-
void testActuatorEndpointExists(String endpoint) throws IOException {
319+
void testActuatorEndpointExists(String endpoint) throws IOException, URISyntaxException {
319320

320321
CloseableHttpClient httpclient = HttpClients.createDefault();
321-
CloseableHttpResponse response = httpclient.execute(new HttpGet("http://localhost:" + port + "/actuator/" + endpoint));
322+
CloseableHttpResponse response = httpclient.execute(new HttpGet(new URI("http", null, "localhost", port, "/actuator/" + endpoint, null, null)));
322323
int statusCode = response.getStatusLine().getStatusCode();
323324
assertEquals(200, statusCode);
324325

0 commit comments

Comments
 (0)