Skip to content

Commit

Permalink
checked default values
Browse files Browse the repository at this point in the history
  • Loading branch information
KalmanMeth committed Mar 9, 2023
1 parent 51572ea commit 5b976fd
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions pkg/pipeline/ingest/ingest_synthetic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ import (
)

func TestIngestSynthetic(t *testing.T) {
// check default values
params := config.StageParam{
Ingest: &config.Ingest{
Type: "synthetic",
Synthetic: &api.IngestSynthetic{},
},
}
ingest, err := NewIngestSynthetic(params)
syn := ingest.(*IngestSynthetic)
require.NoError(t, err)
require.Equal(t, defaultBatchLen, syn.params.BatchMaxLen)
require.Equal(t, defaultConnections, syn.params.Connections)
require.Equal(t, defaultFlowLogsPerMin, syn.params.FlowLogsPerMin)

batchMaxLen := 3
connections := 20
flowLogsPerMin := 1000
Expand All @@ -34,14 +48,14 @@ func TestIngestSynthetic(t *testing.T) {
Connections: connections,
FlowLogsPerMin: flowLogsPerMin,
}
params := config.StageParam{
params = config.StageParam{
Ingest: &config.Ingest{
Type: "synthetic",
Synthetic: &synthetic,
},
}
ingest, err := NewIngestSynthetic(params)
syn := ingest.(*IngestSynthetic)
ingest, err = NewIngestSynthetic(params)
syn = ingest.(*IngestSynthetic)
require.NoError(t, err)
require.Equal(t, batchMaxLen, syn.params.BatchMaxLen)
require.Equal(t, connections, syn.params.Connections)
Expand Down

0 comments on commit 5b976fd

Please sign in to comment.