Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of groovy test classes #13235

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package io.opentelemetry.instrumentation.netty.v4_1;

import static io.opentelemetry.instrumentation.test.base.HttpClientTest.getPort;
import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;

Expand Down Expand Up @@ -138,6 +137,18 @@ private static String getExpectedClientSpanName(URI uri, String method) {
}
}

private static int getPort(URI uri) {
if (uri.getPort() != -1) {
return uri.getPort();
} else if ("http".equals(uri.getScheme())) {
return 80;
} else if ("https".equals(uri.getScheme())) {
return 443;
} else {
throw new IllegalArgumentException("Unexpected uri: " + uri);
}
}

@Test
void closeChannel() throws ExecutionException, InterruptedException {
String method = "GET";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,6 @@ abstract class HttpClientTest<REQUEST> extends InstrumentationSpecification {
server.stop()
}

static int getPort(URI uri) {
if (uri.port != -1) {
return uri.port
} else if (uri.scheme == "http") {
return 80
} else if (uri.scheme == "https") {
443
} else {
throw new IllegalArgumentException("Unexpected uri: $uri")
}
}

def "basic GET request #path"() {
expect:
junitTest.successfulGetRequest(path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ URI resolveWithoutFragment(URI address) throws URISyntaxException {

/**
* Populates custom test attributes for the {@link
* io.opentelemetry.instrumentation.test.base.HttpServerTest#controller} span (which must be the
* current span when this is called) based on URL parameters. Required for {@link #INDEXED_CHILD}.
* io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest#controller} span
* (which must be the current span when this is called) based on URL parameters. Required for
* {@link #INDEXED_CHILD}.
*/
public void collectSpanAttributes(ServerEndpoint.UrlParameterProvider parameterProvider) {
if (this == INDEXED_CHILD) {
Expand Down
Loading