Skip to content
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 @@ -43,8 +43,7 @@ class PekkoHttpClientInstrumentationTest
HttpClientInstrumentationExtension.forAgent()

val system: ActorSystem = ActorSystem.create()
implicit val materializer: ActorMaterializer =
ActorMaterializer.create(system)
val materializer: ActorMaterializer = ActorMaterializer.create(system)

override def buildRequest(
method: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.apache.pekko.http.scaladsl.server.Directives.{
pathPrefix,
pathSingleSlash
}
import org.apache.pekko.stream.ActorMaterializer
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.extension.RegisterExtension
import org.junit.jupiter.api.{AfterAll, Test, TestInstance}
Expand All @@ -42,7 +41,6 @@ class PekkoHttpServerRouteTest {
private val client: WebClient = WebClient.of()

implicit val system: ActorSystem = ActorSystem("my-system")
implicit val materializer: ActorMaterializer = ActorMaterializer()

private def buildAddress(port: Int): URI = try
new URI("http://localhost:" + port + "/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.Http.ServerBinding
import org.apache.pekko.http.scaladsl.model.HttpMethods.GET
import org.apache.pekko.http.scaladsl.model._
import org.apache.pekko.stream.ActorMaterializer
import io.opentelemetry.instrumentation.testing.junit.http.{
AbstractHttpServerTest,
ServerEndpoint
Expand All @@ -22,7 +21,6 @@ import scala.concurrent.{Await, ExecutionContextExecutor, Future}

object PekkoHttpTestAsyncWebServer {
implicit val system: ActorSystem = ActorSystem("my-system")
implicit val materializer: ActorMaterializer = ActorMaterializer()
// needed for the future flatMap/onComplete in the end
implicit val executionContext: ExecutionContextExecutor = system.dispatcher
val asyncHandler: HttpRequest => Future[HttpResponse] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.Http.ServerBinding
import org.apache.pekko.http.scaladsl.model.StatusCodes.Found
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.stream.ActorMaterializer
import org.apache.pekko.stream.scaladsl.Sink

import scala.concurrent.Await
import scala.concurrent.{Await, ExecutionContext}

object PekkoHttpTestServerSourceWebServer {
implicit val system = ActorSystem("my-system")
implicit val materializer = ActorMaterializer()
implicit val system: ActorSystem = ActorSystem("my-system")
// needed for the future flatMap/onComplete in the end
implicit val executionContext = system.dispatcher
implicit val executionContext: ExecutionContext = system.dispatcher

var route = get {
concat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,19 @@ import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.Http.ServerBinding
import org.apache.pekko.http.scaladsl.model.HttpMethods.GET
import org.apache.pekko.http.scaladsl.model._
import org.apache.pekko.stream.ActorMaterializer
import io.opentelemetry.instrumentation.testing.junit.http.{
AbstractHttpServerTest,
ServerEndpoint
}
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint._

import java.util.function.Supplier
import scala.concurrent.Await
import scala.concurrent.{Await, ExecutionContext}

object PekkoHttpTestSyncWebServer {
implicit val system = ActorSystem("my-system")
implicit val materializer = ActorMaterializer()
implicit val system: ActorSystem = ActorSystem("my-system")
// needed for the future flatMap/onComplete in the end
implicit val executionContext = system.dispatcher
implicit val executionContext: ExecutionContext = system.dispatcher
val syncHandler: HttpRequest => HttpResponse = {
case HttpRequest(GET, uri: Uri, _, _, _) => {
val endpoint = ServerEndpoint.forPath(uri.path.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ import org.apache.pekko.http.scaladsl.Http
import org.apache.pekko.http.scaladsl.Http.ServerBinding
import org.apache.pekko.http.scaladsl.model.StatusCodes.Found
import org.apache.pekko.http.scaladsl.server.Directives._
import org.apache.pekko.stream.ActorMaterializer

import scala.concurrent.Await
import scala.concurrent.{Await, ExecutionContext}

object PekkoHttpTestWebServer {
implicit val system = ActorSystem("my-system")
implicit val materializer = ActorMaterializer()
implicit val system: ActorSystem = ActorSystem("my-system")
// needed for the future flatMap/onComplete in the end
implicit val executionContext = system.dispatcher
implicit val executionContext: ExecutionContext = system.dispatcher

var route = get {
concat(
Expand Down
Loading