Skip to content

Commit

Permalink
Merge pull request #823 from jhrozek/artifact_ingester_test
Browse files Browse the repository at this point in the history
tests: Add a test to initialize the artifact ingester
  • Loading branch information
JAORMX authored Sep 1, 2023
2 parents 51e7998 + 602fc93 commit fec4e37
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions internal/engine/ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/stacklok/mediator/internal/engine/ingester/artifact"
"github.com/stacklok/mediator/internal/engine/ingester/builtin"
"github.com/stacklok/mediator/internal/engine/ingester/rest"
pb "github.com/stacklok/mediator/pkg/generated/protobuf/go/mediator/v1"
Expand All @@ -39,6 +40,32 @@ func TestNewRuleDataIngest(t *testing.T) {
args args
wantErr bool
}{
{
name: "artifact",
args: args{
rt: &pb.RuleType{
Def: &pb.RuleType_Definition{
Ingest: &pb.RuleType_Definition_Ingest{
Type: artifact.ArtifactRuleDataIngestType,
Artifact: &pb.ArtifactType{},
},
},
},
},
},
{
name: "artifact missing",
args: args{
rt: &pb.RuleType{
Def: &pb.RuleType_Definition{
Ingest: &pb.RuleType_Definition_Ingest{
Type: artifact.ArtifactRuleDataIngestType,
},
},
},
},
wantErr: true,
},
{
name: "rest",
args: args{
Expand Down

0 comments on commit fec4e37

Please sign in to comment.