Skip to content

Commit fa7eca6

Browse files
committed
cleanups
1 parent 546afe3 commit fa7eca6

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

instrumentation/ratpack/ratpack-1.7/library/src/test/java/io/opentelemetry/instrumentation/ratpack/v1_7/client/InstrumentedHttpClientTest.java

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ void testPropagateTraceWithHttpCalls() throws Exception {
123123
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L),
124124
satisfies(SERVER_PORT, v -> v.isInstanceOf(Long.class)),
125125
equalTo(SERVER_ADDRESS, "localhost"),
126-
equalTo(
127-
URL_FULL,
128-
"http://localhost:" + otherApp.getServer().getBindPort() + "/bar")),
126+
equalTo(URL_FULL, otherApp.getAddress() + "/bar")),
129127
span ->
130128
span.hasName("GET /bar")
131129
.hasParent(trace.getSpan(1))
@@ -214,9 +212,7 @@ void testAddSpansForMultipleConcurrentClientCalls() throws Exception {
214212
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L),
215213
satisfies(SERVER_PORT, v -> v.isInstanceOf(Long.class)),
216214
equalTo(SERVER_ADDRESS, "localhost"),
217-
equalTo(
218-
URL_FULL,
219-
"http://localhost:" + otherApp.getServer().getBindPort() + "/foo")),
215+
equalTo(URL_FULL, otherApp.getAddress() + "/foo")),
220216
span ->
221217
span.hasName("GET")
222218
.hasParent(trace.getSpan(0))
@@ -227,11 +223,7 @@ void testAddSpansForMultipleConcurrentClientCalls() throws Exception {
227223
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L),
228224
satisfies(SERVER_PORT, v -> v.isInstanceOf(Long.class)),
229225
equalTo(SERVER_ADDRESS, "localhost"),
230-
equalTo(
231-
URL_FULL,
232-
"http://localhost:"
233-
+ otherApp.getServer().getBindPort()
234-
+ "/bar"))));
226+
equalTo(URL_FULL, otherApp.getAddress() + "/bar"))));
235227
}
236228

237229
@Test
@@ -306,11 +298,7 @@ void testHandlingExceptionErrorsInHttpClient() throws Exception {
306298
equalTo(ERROR_TYPE, HttpClientReadTimeoutException.class.getName()),
307299
satisfies(SERVER_PORT, v -> v.isInstanceOf(Long.class)),
308300
equalTo(SERVER_ADDRESS, "localhost"),
309-
equalTo(
310-
URL_FULL,
311-
"http://localhost:"
312-
+ otherApp.getServer().getBindPort()
313-
+ "/foo"))));
301+
equalTo(URL_FULL, otherApp.getAddress() + "/foo"))));
314302
}
315303

316304
private static Stream<Arguments> provideArguments() {
@@ -363,9 +351,7 @@ void propagateHttpTraceInRatpackServicesWithForkExecutions(
363351
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L),
364352
satisfies(SERVER_PORT, v -> v.isInstanceOf(Long.class)),
365353
equalTo(SERVER_ADDRESS, "localhost"),
366-
equalTo(
367-
URL_FULL,
368-
"http://localhost:" + otherApp.getServer().getBindPort() + "/foo")),
354+
equalTo(URL_FULL, otherApp.getAddress() + "foo")),
369355
span ->
370356
span.hasName("GET")
371357
.hasKind(SpanKind.CLIENT)
@@ -376,10 +362,6 @@ void propagateHttpTraceInRatpackServicesWithForkExecutions(
376362
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L),
377363
satisfies(SERVER_PORT, v -> v.isInstanceOf(Long.class)),
378364
equalTo(SERVER_ADDRESS, "localhost"),
379-
equalTo(
380-
URL_FULL,
381-
"http://localhost:"
382-
+ otherApp.getServer().getBindPort()
383-
+ "/foo"))));
365+
equalTo(URL_FULL, otherApp.getAddress() + "foo"))));
384366
}
385367
}

0 commit comments

Comments
 (0)