Skip to content

Commit 157fb81

Browse files
committed
better valdiation
1 parent 9b5c7f2 commit 157fb81

File tree

1 file changed

+10
-4
lines changed
  • opentelemetry-otlp/src/exporter

1 file changed

+10
-4
lines changed

opentelemetry-otlp/src/exporter/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ mod tests {
342342
#[cfg(feature = "logs")]
343343
#[cfg(any(feature = "http-proto", feature = "http-json"))]
344344
#[test]
345-
fn invalid_http_endpoint() {
345+
fn export_builder_error_invalid_http_endpoint() {
346346
use std::time::Duration;
347347

348348
use crate::{ExportConfig, LogExporter, Protocol, WithExportConfig};
@@ -358,12 +358,15 @@ mod tests {
358358
.with_export_config(ex_config)
359359
.build();
360360

361-
assert!(exporter_result.is_err());
361+
assert!(matches!(
362+
exporter_result,
363+
Err(crate::exporter::ExporterBuildError::InvalidUri(_, _))
364+
));
362365
}
363366

364367
#[cfg(feature = "grpc-tonic")]
365368
#[test]
366-
fn invalid_grpc_endpoint() {
369+
fn export_builder_error_invalid_grpc_endpoint() {
367370
use std::time::Duration;
368371

369372
use crate::{ExportConfig, LogExporter, Protocol, WithExportConfig};
@@ -379,7 +382,10 @@ mod tests {
379382
.with_export_config(ex_config)
380383
.build();
381384

382-
assert!(exporter_result.is_err());
385+
assert!(matches!(
386+
exporter_result,
387+
Err(crate::exporter::ExporterBuildError::InvalidUri(_, _))
388+
));
383389
}
384390

385391
#[cfg(feature = "grpc-tonic")]

0 commit comments

Comments
 (0)