Skip to content

Commit 022f631

Browse files
committed
Remove usage of groovy test classes
1 parent b1f72b6 commit 022f631

File tree

4 files changed

+15
-20
lines changed
  • instrumentation
    • netty/netty-4.1/testing/src/main/java/io/opentelemetry/instrumentation/netty/v4_1
    • spring/spring-webflux/spring-webflux-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/v5_0/server/base
  • testing-common/src/main

4 files changed

+15
-20
lines changed

instrumentation/netty/netty-4.1/testing/src/main/java/io/opentelemetry/instrumentation/netty/v4_1/AbstractNetty41ClientTest.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package io.opentelemetry.instrumentation.netty.v4_1;
77

8-
import static io.opentelemetry.instrumentation.test.base.HttpClientTest.getPort;
98
import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
109
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
1110

@@ -138,6 +137,18 @@ private static String getExpectedClientSpanName(URI uri, String method) {
138137
}
139138
}
140139

140+
private static int getPort(URI uri) {
141+
if (uri.getPort() != -1) {
142+
return uri.getPort();
143+
} else if ("http".equals(uri.getScheme())) {
144+
return 80;
145+
} else if ("https".equals(uri.getScheme())) {
146+
return 443;
147+
} else {
148+
throw new IllegalArgumentException("Unexpected uri: " + uri);
149+
}
150+
}
151+
141152
@Test
142153
void closeChannel() throws ExecutionException, InterruptedException {
143154
String method = "GET";

instrumentation/spring/spring-webflux/spring-webflux-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/v5_0/server/base/package-info.java

-5
This file was deleted.

testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpClientTest.groovy

-12
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,6 @@ abstract class HttpClientTest<REQUEST> extends InstrumentationSpecification {
162162
server.stop()
163163
}
164164

165-
static int getPort(URI uri) {
166-
if (uri.port != -1) {
167-
return uri.port
168-
} else if (uri.scheme == "http") {
169-
return 80
170-
} else if (uri.scheme == "https") {
171-
443
172-
} else {
173-
throw new IllegalArgumentException("Unexpected uri: $uri")
174-
}
175-
}
176-
177165
def "basic GET request #path"() {
178166
expect:
179167
junitTest.successfulGetRequest(path)

testing-common/src/main/java/io/opentelemetry/instrumentation/testing/junit/http/ServerEndpoint.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ URI resolveWithoutFragment(URI address) throws URISyntaxException {
121121

122122
/**
123123
* Populates custom test attributes for the {@link
124-
* io.opentelemetry.instrumentation.test.base.HttpServerTest#controller} span (which must be the
125-
* current span when this is called) based on URL parameters. Required for {@link #INDEXED_CHILD}.
124+
* io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest#controller} span
125+
* (which must be the current span when this is called) based on URL parameters. Required for
126+
* {@link #INDEXED_CHILD}.
126127
*/
127128
public void collectSpanAttributes(ServerEndpoint.UrlParameterProvider parameterProvider) {
128129
if (this == INDEXED_CHILD) {

0 commit comments

Comments
 (0)