Skip to content

Commit

Permalink
Fix tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobebway committed Oct 18, 2023
1 parent ba4ac5c commit d843e1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ func Test_DeleteEventingCR(t *testing.T) {
utils.WithEventMeshBackend("test-secret-name"),
utils.WithEventingPublisherData(1, 1, "199m", "99Mi", "399m", "199Mi"),
utils.WithEventingEventTypePrefix("test-prefix"),
utils.WithEventingDomain(utils.Domain),
),
givenSubscription: utils.NewSubscription("test-eventmesh-subscription", "test-eventmesh-namespace"),
wantMatches: gomega.And(
Expand Down
16 changes: 1 addition & 15 deletions test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,30 +326,16 @@ func NewSubscription(name, namespace string) *eventinv1alpha2.Subscription {
}
}

type ConfigMapOption func(*v1.ConfigMap)

func NewConfigMap(name, namespace string, opts ...ConfigMapOption) *v1.ConfigMap {
func NewConfigMap(name, namespace string) *v1.ConfigMap {
cm := &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
}
for _, opt := range opts {
opt(cm)
}
return cm
}

func WithConfigMapData(key, value string) ConfigMapOption {
return func(cm *v1.ConfigMap) {
if cm.Data == nil {
cm.Data = map[string]string{}
}
cm.Data[key] = value
}
}

func FindObjectByKind(kind string, objects []client.Object) (client.Object, error) {
for _, obj := range objects {
if obj.GetObjectKind().GroupVersionKind().Kind == kind {
Expand Down

0 comments on commit d843e1e

Please sign in to comment.