Skip to content

Commit 5d5e06e

Browse files
committed
test default protocol
1 parent 277df67 commit 5d5e06e

File tree

1 file changed

+14
-5
lines changed
  • opentelemetry-otlp/src/exporter

1 file changed

+14
-5
lines changed

opentelemetry-otlp/src/exporter/mod.rs

+14-5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub const OTEL_EXPORTER_OTLP_COMPRESSION: &str = "OTEL_EXPORTER_OTLP_COMPRESSION
3030

3131
#[cfg(all(
3232
feature = "trace",
33+
feature = "http-json",
3334
not(feature = "http-proto"),
3435
not(feature = "grpc-tonic")
3536
))]
@@ -315,17 +316,25 @@ mod tests {
315316
);
316317
}
317318

318-
#[cfg(feature = "http-json")]
319+
#[cfg(all(
320+
feature = "trace",
321+
feature = "http-json",
322+
not(feature = "http-proto"),
323+
not(feature = "grpc-tonic")
324+
))]
319325
#[test]
320-
fn test_default_http_json_endpoint() {
321-
use crate::WithExportConfig;
322-
323-
let exporter_builder = crate::new_exporter().http().with_protocol(crate::Protocol::HttpJson);
326+
fn test_http_json_defaults() {
327+
let exporter_builder = crate::new_exporter().http();
324328

325329
assert_eq!(
326330
exporter_builder.exporter_config.endpoint,
327331
"http://localhost:4318"
328332
);
333+
334+
assert_eq!(
335+
exporter_builder.exporter_config.protocol,
336+
crate::Protocol::HttpJson
337+
);
329338
}
330339

331340
#[test]

0 commit comments

Comments
 (0)