io.opentelemetry.instrumentation.testing.junit.http.SingleConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-testing-common Show documentation
Show all versions of opentelemetry-testing-common Show documentation
OpenTelemetry Javaagent testing commons
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.instrumentation.testing.junit.http;
import java.util.Map;
/**
* Helper class for http client tests which require a single connection.
*
* Tests for specific library should provide an implementation which satisfies the following
* conditions:
*
*
* - Has a constructor which accepts target host and port
*
- For a given instance all invocations of {@link #doRequest(String, Map)} will reuse the same
* underlying connection to target host.
*
*/
public interface SingleConnection {
String REQUEST_ID_HEADER = "test-request-id";
int doRequest(String path, Map headers) throws Exception;
}