Skip to content

Commit 59b7b9e

Browse files
committed
remove new http test
1 parent acb4ff5 commit 59b7b9e

File tree

2 files changed

+6
-56
lines changed

2 files changed

+6
-56
lines changed

instrumentation/pekko/pekko-http-1.0/javaagent/src/test/scala/io/opentelemetry/javaagent/instrumentation/pekkohttp/v1_0/PekkoHttpServerInstrumentationTestAsync.scala

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,10 @@
66
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0
77

88
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension
9-
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.SUCCESS
109
import io.opentelemetry.instrumentation.testing.junit.http.{
1110
HttpServerInstrumentationExtension,
1211
HttpServerTestOptions
1312
}
14-
import io.opentelemetry.testing.internal.armeria.common.{
15-
AggregatedHttpRequest,
16-
AggregatedHttpResponse
17-
}
18-
import org.assertj.core.api.Assertions.assertThat
19-
import org.junit.jupiter.api.Test
2013
import org.junit.jupiter.api.extension.RegisterExtension
2114

2215
class PekkoHttpServerInstrumentationTestAsync
@@ -39,23 +32,4 @@ class PekkoHttpServerInstrumentationTestAsync
3932
super.configure(options)
4033
options.setTestHttpPipelining(false)
4134
}
42-
43-
@Test
44-
def successfulPostRequestWithParent(): Unit = {
45-
val method = "POST"
46-
val traceId = "00000000000000000000000000000123"
47-
val parentId = "0000000000000456"
48-
val aggregatedHttpRequest = AggregatedHttpRequest
49-
.of( // intentionally sending mixed-case "tracePARENT" to make sure that TextMapGetters are
50-
// not case-sensitive
51-
request(SUCCESS, method).headers.toBuilder
52-
.set("tracePARENT", "00-" + traceId + "-" + parentId + "-01")
53-
.build
54-
)
55-
val response = client.execute(aggregatedHttpRequest).aggregate.join
56-
assertThat(response.status.code).isEqualTo(SUCCESS.getStatus)
57-
assertThat(response.contentUtf8).isEqualTo(SUCCESS.getBody)
58-
val spanId = assertResponseHasCustomizedHeaders(response, SUCCESS, traceId)
59-
assertTheTraces(1, traceId, parentId, spanId, "POST", SUCCESS)
60-
}
6135
}

instrumentation/pekko/pekko-http-1.0/javaagent/src/test/scala/io/opentelemetry/javaagent/instrumentation/pekkohttp/v1_0/PekkoHttpTestAsyncWebServer.scala

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@
55

66
package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0
77

8-
import io.opentelemetry.api.trace.Span
9-
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint._
10-
import io.opentelemetry.instrumentation.testing.junit.http.{
11-
AbstractHttpServerTest,
12-
ServerEndpoint
13-
}
148
import org.apache.pekko.actor.ActorSystem
159
import org.apache.pekko.http.scaladsl.Http
1610
import org.apache.pekko.http.scaladsl.Http.ServerBinding
17-
import org.apache.pekko.http.scaladsl.model.HttpMethods.{GET, POST}
18-
import org.apache.pekko.http.scaladsl.model.StatusCodes.OK
11+
import org.apache.pekko.http.scaladsl.model.HttpMethods.GET
1912
import org.apache.pekko.http.scaladsl.model._
20-
import org.apache.pekko.pattern.after
2113
import org.apache.pekko.stream.ActorMaterializer
14+
import io.opentelemetry.instrumentation.testing.junit.http.{
15+
AbstractHttpServerTest,
16+
ServerEndpoint
17+
}
18+
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint._
2219

2320
import java.util.function.Supplier
24-
import scala.concurrent.duration.DurationInt
2521
import scala.concurrent.{Await, ExecutionContextExecutor, Future}
2622

2723
object PekkoHttpTestAsyncWebServer {
@@ -61,26 +57,6 @@ object PekkoHttpTestAsyncWebServer {
6157
}
6258
)
6359
}
64-
case HttpRequest(POST, uri: Uri, _, _, _) =>
65-
val endpoint = ServerEndpoint.forPath(uri.path.toString())
66-
AbstractHttpServerTest.controller(
67-
endpoint,
68-
() =>
69-
for {
70-
_ <- Future.successful(2)
71-
firstSpanContext = Span.current().getSpanContext()
72-
_ <- after(1.second, system.scheduler)(Future.successful(1))
73-
secondSpanContext = Span.current().getSpanContext()
74-
_ = require(
75-
firstSpanContext.getTraceId() == secondSpanContext.getTraceId(),
76-
s"TraceId ${firstSpanContext.getTraceId()} did not match ${secondSpanContext.getTraceId()}"
77-
)
78-
_ = require(
79-
firstSpanContext.getSpanId() == secondSpanContext.getSpanId(),
80-
s"SpanId ${firstSpanContext.getSpanId()} did not match ${secondSpanContext.getSpanId()}"
81-
)
82-
} yield HttpResponse(status = OK, entity = endpoint.getBody)
83-
)
8460
}
8561

8662
private var binding: ServerBinding = _

0 commit comments

Comments
 (0)