Skip to content

Commit

Permalink
add test for invalid protocol
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
  • Loading branch information
codeboten committed May 16, 2024
1 parent d4cb1c0 commit a246792
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions config/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,29 @@ func TestLogProcessor(t *testing.T) {
},
wantProcessor: sdklog.NewBatchProcessor(otlpHTTPExporter),
},
{
name: "batch/otlp-http-invalid-protocol",
processor: LogRecordProcessor{
Batch: &BatchLogRecordProcessor{
MaxExportBatchSize: ptr(0),
ExportTimeout: ptr(0),
MaxQueueSize: ptr(0),
ScheduleDelay: ptr(0),
Exporter: LogRecordExporter{
OTLP: &OTLP{
Protocol: "invalid",
Endpoint: "https://10.0.0.0:443",
Compression: ptr("gzip"),
Timeout: ptr(1000),
Headers: map[string]string{
"test": "test1",
},
},
},
},
},
wantErr: errors.New("unsupported protocol \"invalid\""),
},
{
name: "batch/otlp-http-invalid-endpoint",
processor: LogRecordProcessor{
Expand Down

0 comments on commit a246792

Please sign in to comment.