Channel single event helper, send events via sendeventtoaddressable
@@ -30,6 +30,7 @@ import (
testlib "knative.dev/eventing/test/lib"
"knative.dev/eventing/test/lib/recordevents"
"knative.dev/eventing/test/lib/resources"
+ "knative.dev/eventing/test/lib/sender"
)
type SubscriptionVersion string
@@ -108,20 +109,14 @@ func SingleEventForChannelTestHelper(
st.Fatalf("Cannot set the payload of the event: %s", err.Error())
}
- //TODO(slinkydeveloper) this is temporary, it will be replaced with SendEventToAddressable
- uri, err := client.GetAddressableURI(channelName, &channel)
- if err != nil {
- client.T.Fatalf("Failed to get the URI for %+v-%s", &channel, channelName)
- }
-
- recordevents.DeployEventSenderOrFail(
+ client.SendEventToAddressable(
ctx,
- client,
senderName,
- uri,
- recordevents.InputEvent(event),
- recordevents.InputEncoding(encoding),
- recordevents.EnableIncrementalId(),
+ channelName,
+ &channel,
+ event,
+ sender.WithEncoding(encoding),
+ sender.EnableIncrementalId(),
)
// verify the logger service receives the event
