Skip to content

Commit

Permalink
Convert some ratpack tests to java (#12825)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Dec 12, 2024
1 parent 61b8f72 commit a83b600
Show file tree
Hide file tree
Showing 40 changed files with 1,092 additions and 1,076 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.ratpack;
package io.opentelemetry.javaagent.instrumentation.ratpack.client;

import io.opentelemetry.instrumentation.ratpack.client.AbstractRatpackForkedHttpClientTest;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.ratpack;
package io.opentelemetry.javaagent.instrumentation.ratpack.client;

import io.opentelemetry.instrumentation.ratpack.client.AbstractRatpackHttpClientTest;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.ratpack;
package io.opentelemetry.javaagent.instrumentation.ratpack.client;

import io.opentelemetry.instrumentation.ratpack.client.AbstractRatpackPooledHttpClientTest;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.ratpack.server;

import io.opentelemetry.instrumentation.ratpack.server.AbstractRatpackAsyncHttpServerTest;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerTestOptions;
import org.junit.jupiter.api.extension.RegisterExtension;
import ratpack.server.RatpackServerSpec;

class RatpackAsyncHttpServerTest extends AbstractRatpackAsyncHttpServerTest {

@RegisterExtension
public static final InstrumentationExtension testing =
HttpServerInstrumentationExtension.forAgent();

@Override
protected void configure(RatpackServerSpec serverSpec) {}

@Override
protected void configure(HttpServerTestOptions options) {
super.configure(options);

options.setHasResponseCustomizer(endpoint -> true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.ratpack.server;

import io.opentelemetry.instrumentation.ratpack.server.AbstractRatpackForkedHttpServerTest;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerTestOptions;
import org.junit.jupiter.api.extension.RegisterExtension;
import ratpack.server.RatpackServerSpec;

class RatpackForkedHttpServerTest extends AbstractRatpackForkedHttpServerTest {

@RegisterExtension
public static final InstrumentationExtension testing =
HttpServerInstrumentationExtension.forAgent();

@Override
protected void configure(RatpackServerSpec serverSpec) {}

@Override
protected void configure(HttpServerTestOptions options) {
super.configure(options);

options.setHasResponseCustomizer(endpoint -> true);
options.setTestHttpPipelining(false);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.ratpack.server;

import io.opentelemetry.instrumentation.ratpack.server.AbstractRatpackHttpServerTest;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerTestOptions;
import org.junit.jupiter.api.extension.RegisterExtension;
import ratpack.server.RatpackServerSpec;

class RatpackHttpServerTest extends AbstractRatpackHttpServerTest {

@RegisterExtension
public static final InstrumentationExtension testing =
HttpServerInstrumentationExtension.forAgent();

@Override
protected void configure(RatpackServerSpec serverSpec) {}

@Override
protected void configure(HttpServerTestOptions options) {
super.configure(options);

options.setHasResponseCustomizer(endpoint -> true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.ratpack.server;

import io.opentelemetry.instrumentation.ratpack.server.AbstractRatpackRoutesTest;
import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;
import ratpack.server.RatpackServerSpec;

class RatpackRoutesTest extends AbstractRatpackRoutesTest {

@RegisterExtension
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();

@Override
protected InstrumentationExtension testing() {
return testing;
}

@Override
protected void configure(RatpackServerSpec serverSpec) {}

@Override
protected boolean hasHandlerSpan() {
return true;
}
}

This file was deleted.

Loading

0 comments on commit a83b600

Please sign in to comment.