Skip to content

Commit

Permalink
Add ceoverrides to unit test objects
Browse files Browse the repository at this point in the history
  • Loading branch information
navidshaikh committed May 29, 2020
1 parent cdc98fc commit e8843ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
17 changes: 10 additions & 7 deletions pkg/sources/v1alpha2/apiserver_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,16 @@ func TestListAPIServerSource(t *testing.T) {
}

func newAPIServerSource(name, resource string) *v1alpha2.ApiServerSource {
b := NewAPIServerSourceBuilder(name).ServiceAccount("testsa").EventMode("Reference")
b.Sink(duckv1.Destination{
Ref: &duckv1.KReference{
Kind: "Service",
Name: "foosvc",
Namespace: "default",
}})
b := NewAPIServerSourceBuilder(name).
ServiceAccount("testsa").
EventMode("Reference").
CloudEventOverrides(map[string]string{"type": "foo"}, []string{}).
Sink(duckv1.Destination{
Ref: &duckv1.KReference{
Kind: "Service",
Name: "foosvc",
Namespace: "default",
}})

if resource != "" {
b.Resources([]v1alpha2.APIVersionKindSelector{{
Expand Down
3 changes: 2 additions & 1 deletion pkg/sources/v1alpha2/ping_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func TestListPingSource(t *testing.T) {
func newPingSource(name string, sink string) *v1alpha2.PingSource {
b := NewPingSourceBuilder(name).
Schedule("* * * * *").
JsonData("mydata")
JsonData("mydata").
CloudEventOverrides(map[string]string{"type": "foo"}, []string{})

if sink != "" {
b.Sink(
Expand Down

0 comments on commit e8843ae

Please sign in to comment.