61 lines
1.3 KiB
Groovy
61 lines
1.3 KiB
Groovy
/*
|
|
* Copyright The OpenTelemetry Authors
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import io.opentelemetry.instrumentation.test.AgentTestTrait
|
|
import io.opentelemetry.instrumentation.test.base.HttpServerTest
|
|
|
|
abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object> implements AgentTestTrait {
|
|
|
|
// FIXME: This doesn't work because we don't support bindAndHandle.
|
|
// @Override
|
|
// def startServer(int port) {
|
|
// AkkaHttpTestWebServer.start(port)
|
|
// }
|
|
//
|
|
// @Override
|
|
// void stopServer(Object ignore) {
|
|
// AkkaHttpTestWebServer.stop()
|
|
// }
|
|
|
|
@Override
|
|
String expectedServerSpanName(ServerEndpoint endpoint) {
|
|
return "akka.request"
|
|
}
|
|
|
|
@Override
|
|
boolean testCapturedHttpHeaders() {
|
|
false
|
|
}
|
|
|
|
@Override
|
|
boolean testConcurrency() {
|
|
return true
|
|
}
|
|
}
|
|
|
|
class AkkaHttpServerInstrumentationTestSync extends AkkaHttpServerInstrumentationTest {
|
|
@Override
|
|
def startServer(int port) {
|
|
AkkaHttpTestSyncWebServer.start(port)
|
|
}
|
|
|
|
@Override
|
|
void stopServer(Object ignore) {
|
|
AkkaHttpTestSyncWebServer.stop()
|
|
}
|
|
}
|
|
|
|
class AkkaHttpServerInstrumentationTestAsync extends AkkaHttpServerInstrumentationTest {
|
|
@Override
|
|
def startServer(int port) {
|
|
AkkaHttpTestAsyncWebServer.start(port)
|
|
}
|
|
|
|
@Override
|
|
void stopServer(Object ignore) {
|
|
AkkaHttpTestAsyncWebServer.stop()
|
|
}
|
|
}
|