@@ -360,7 +360,11 @@ func TestRequestNoBodyNoReply(t *testing.T) {
360360
361361 dataID := fftypes .NewUUID ()
362362 groupHash := fftypes .NewRandB32 ()
363- sub := & core.Subscription {}
363+ sub := & core.Subscription {
364+ SubscriptionRef : core.SubscriptionRef {
365+ Namespace : "ns1" ,
366+ },
367+ }
364368 to := sub .Options .TransportOptions ()
365369 to ["url" ] = fmt .Sprintf ("http://%s/myapi" , server .Listener .Addr ())
366370 event := & core.EventDelivery {
@@ -380,7 +384,8 @@ func TestRequestNoBodyNoReply(t *testing.T) {
380384 },
381385 },
382386 Subscription : core.SubscriptionRef {
383- ID : sub .ID ,
387+ ID : sub .ID ,
388+ Namespace : "ns1" ,
384389 },
385390 }
386391 data := & core.Data {
@@ -390,9 +395,16 @@ func TestRequestNoBodyNoReply(t *testing.T) {
390395 }` ),
391396 }
392397
398+ mcb := wh .callbacks ["ns1" ].(* eventsmocks.Callbacks )
399+ mcb .On ("DeliveryResponse" , mock .Anything , mock .MatchedBy (func (response * core.EventDeliveryResponse ) bool {
400+ return ! response .Rejected
401+ })).Return (nil )
402+
393403 err := wh .DeliveryRequest (mock .Anything , sub , event , core.DataArray {data })
394404 assert .NoError (t , err )
395405 assert .True (t , called )
406+
407+ mcb .AssertExpectations (t )
396408}
397409
398410func TestRequestReplyEmptyData (t * testing.T ) {
@@ -638,7 +650,7 @@ func TestRequestReplyDataArrayError(t *testing.T) {
638650 mcb .AssertExpectations (t )
639651}
640652
641- func TestRequestReplyBuildRequestFailFastAsk (t * testing.T ) {
653+ func TestWebhookFailFastAsk (t * testing.T ) {
642654 wh , cancel := newTestWebHooks (t )
643655 defer cancel ()
644656
@@ -652,7 +664,6 @@ func TestRequestReplyBuildRequestFailFastAsk(t *testing.T) {
652664 Namespace : "ns1" ,
653665 },
654666 }
655- sub .Options .TransportOptions ()["reply" ] = true
656667 sub .Options .TransportOptions ()["fastack" ] = true
657668 event := & core.EventDelivery {
658669 EnrichedEvent : core.EnrichedEvent {
@@ -673,17 +684,11 @@ func TestRequestReplyBuildRequestFailFastAsk(t *testing.T) {
673684
674685 waiter := make (chan struct {})
675686 mcb := wh .callbacks ["ns1" ].(* eventsmocks.Callbacks )
676- dr := mcb .On ("DeliveryResponse" , mock .Anything , mock .MatchedBy (func (response * core.EventDeliveryResponse ) bool {
677- assert .Equal (t , * msgID , * response .Reply .Message .Header .CID )
678- assert .Nil (t , response .Reply .Message .Header .Group )
679- assert .Equal (t , core .MessageTypeBroadcast , response .Reply .Message .Header .Type )
680- assert .Equal (t , float64 (502 ), response .Reply .InlineData [0 ].Value .JSONObject ()["status" ])
681- assert .Regexp (t , "FF10242" , response .Reply .InlineData [0 ].Value .JSONObject ().GetObject ("body" )["error" ])
682- return true
683- })).Return (nil )
684- dr .RunFn = func (a mock.Arguments ) {
685- close (waiter )
686- }
687+ mcb .On ("DeliveryResponse" , mock .Anything , mock .Anything ).
688+ Return (nil ).
689+ Run (func (a mock.Arguments ) {
690+ close (waiter )
691+ })
687692
688693 err := wh .DeliveryRequest (mock .Anything , sub , event , core.DataArray {
689694 {ID : fftypes .NewUUID (), Value : fftypes .JSONAnyPtr (`"value1"` )},
0 commit comments