use of com.linecorp.armeria.testing.junit5.server.mock.RecordedRequest in project opentelemetry-java by open-telemetry.
the class OtlpHttpLogExporterTest method testExportTls.
@Test
void testExportTls() {
server.enqueue(successResponse());
OtlpHttpLogExporter exporter = builder.setEndpoint("https://" + canonicalHostName + ":" + server.httpsPort() + "/v1/logs").setTrustedCertificates(HELD_CERTIFICATE.certificatePem().getBytes(StandardCharsets.UTF_8)).build();
ExportLogsServiceRequest payload = exportAndAssertResult(exporter, /* expectedResult= */
true);
RecordedRequest recorded = server.takeRequest();
AggregatedHttpRequest request = recorded.request();
assertRequestCommon(request);
assertThat(parseRequestBody(request.content().array())).isEqualTo(payload);
// OkHttp does support HTTP/2 upgrade on TLS.
assertThat(recorded.context().sessionProtocol().isMultiplex()).isTrue();
}
use of com.linecorp.armeria.testing.junit5.server.mock.RecordedRequest in project opentelemetry-java by open-telemetry.
the class OtlpHttpSpanExporterTest method testExportTls.
@Test
void testExportTls() {
server.enqueue(successResponse());
OtlpHttpSpanExporter exporter = builder.setEndpoint("https://" + canonicalHostName + ":" + server.httpsPort() + "/v1/traces").setTrustedCertificates(HELD_CERTIFICATE.certificatePem().getBytes(StandardCharsets.UTF_8)).build();
ExportTraceServiceRequest payload = exportAndAssertResult(exporter, /* expectedResult= */
true);
RecordedRequest recorded = server.takeRequest();
AggregatedHttpRequest request = recorded.request();
assertRequestCommon(request);
assertThat(parseRequestBody(request.content().array())).isEqualTo(payload);
// OkHttp does support HTTP/2 upgrade on TLS.
assertThat(recorded.context().sessionProtocol().isMultiplex()).isTrue();
}
use of com.linecorp.armeria.testing.junit5.server.mock.RecordedRequest in project opentelemetry-java by open-telemetry.
the class OtlpHttpSpanExporterTest method testExportUncompressed.
@Test
void testExportUncompressed() {
server.enqueue(successResponse());
OtlpHttpSpanExporter exporter = builder.build();
ExportTraceServiceRequest payload = exportAndAssertResult(exporter, /* expectedResult= */
true);
RecordedRequest recorded = server.takeRequest();
AggregatedHttpRequest request = recorded.request();
assertRequestCommon(request);
assertThat(parseRequestBody(request.content().array())).isEqualTo(payload);
// OkHttp does not support HTTP/2 upgrade on plaintext.
assertThat(recorded.context().sessionProtocol().isMultiplex()).isFalse();
}
use of com.linecorp.armeria.testing.junit5.server.mock.RecordedRequest in project opentelemetry-java by open-telemetry.
the class OtlpHttpLogExporterTest method testExportUncompressed.
@Test
void testExportUncompressed() {
server.enqueue(successResponse());
OtlpHttpLogExporter exporter = builder.build();
ExportLogsServiceRequest payload = exportAndAssertResult(exporter, /* expectedResult= */
true);
RecordedRequest recorded = server.takeRequest();
AggregatedHttpRequest request = recorded.request();
assertRequestCommon(request);
assertThat(parseRequestBody(request.content().array())).isEqualTo(payload);
// OkHttp does not support HTTP/2 upgrade on plaintext.
assertThat(recorded.context().sessionProtocol().isMultiplex()).isFalse();
}
Aggregations