EventClientMock is a mock implementation of EventClient. func TestSomethingThatUsesEventClient(t *testing.T) { // make and configure a mocked EventClient mockedEventClient := &EventClientMock{ CreateSubscriptionFunc: func(ctx context.Context, resourceURL string, eventTypes []string) (*Subs
| 41 | // |
| 42 | // } |
| 43 | type EventClientMock struct { |
| 44 | // CreateSubscriptionFunc mocks the CreateSubscription method. |
| 45 | CreateSubscriptionFunc func(ctx context.Context, resourceURL string, eventTypes []string) (*Subscription, bool, error) |
| 46 | |
| 47 | // DeleteSubscriptionFunc mocks the DeleteSubscription method. |
| 48 | DeleteSubscriptionFunc func(ctx context.Context, id string) error |
| 49 | |
| 50 | // GetSubscriptionFunc mocks the GetSubscription method. |
| 51 | GetSubscriptionFunc func(ctx context.Context, id string) (*Subscription, error) |
| 52 | |
| 53 | // ListSubscriptionsFunc mocks the ListSubscriptions method. |
| 54 | ListSubscriptionsFunc func(ctx context.Context, limit int) ([]Subscription, error) |
| 55 | |
| 56 | // OpenStreamFunc mocks the OpenStream method. |
| 57 | OpenStreamFunc func(ctx context.Context, id string) (io.ReadCloser, error) |
| 58 | |
| 59 | // calls tracks calls to the methods. |
| 60 | calls struct { |
| 61 | // CreateSubscription holds details about calls to the CreateSubscription method. |
| 62 | CreateSubscription []struct { |
| 63 | // Ctx is the ctx argument value. |
| 64 | Ctx context.Context |
| 65 | // ResourceURL is the resourceURL argument value. |
| 66 | ResourceURL string |
| 67 | // EventTypes is the eventTypes argument value. |
| 68 | EventTypes []string |
| 69 | } |
| 70 | // DeleteSubscription holds details about calls to the DeleteSubscription method. |
| 71 | DeleteSubscription []struct { |
| 72 | // Ctx is the ctx argument value. |
| 73 | Ctx context.Context |
| 74 | // ID is the id argument value. |
| 75 | ID string |
| 76 | } |
| 77 | // GetSubscription holds details about calls to the GetSubscription method. |
| 78 | GetSubscription []struct { |
| 79 | // Ctx is the ctx argument value. |
| 80 | Ctx context.Context |
| 81 | // ID is the id argument value. |
| 82 | ID string |
| 83 | } |
| 84 | // ListSubscriptions holds details about calls to the ListSubscriptions method. |
| 85 | ListSubscriptions []struct { |
| 86 | // Ctx is the ctx argument value. |
| 87 | Ctx context.Context |
| 88 | // Limit is the limit argument value. |
| 89 | Limit int |
| 90 | } |
| 91 | // OpenStream holds details about calls to the OpenStream method. |
| 92 | OpenStream []struct { |
| 93 | // Ctx is the ctx argument value. |
| 94 | Ctx context.Context |
| 95 | // ID is the id argument value. |
| 96 | ID string |
| 97 | } |
| 98 | } |
| 99 | lockCreateSubscription sync.RWMutex |
| 100 | lockDeleteSubscription sync.RWMutex |
nothing calls this directly
no outgoing calls
no test coverage detected