|
9 | 9 | "github.com/stretchr/testify/assert" |
10 | 10 | ApiV2010 "github.com/twilio/twilio-go/rest/api/v2010" |
11 | 11 | ChatV2 "github.com/twilio/twilio-go/rest/chat/v2" |
12 | | - EventsV1 "github.com/twilio/twilio-go/rest/events/v1" |
13 | 12 | ) |
14 | 13 |
|
15 | 14 | var from string |
@@ -79,39 +78,39 @@ func TestSpecialCharacters(t *testing.T) { |
79 | 78 | assert.Nil(t, err) |
80 | 79 | } |
81 | 80 |
|
82 | | -func TestListParams(t *testing.T) { |
83 | | - sinkConfig := map[string]interface{}{ |
84 | | - "destination": "http://example.org/webhook", |
85 | | - "method": "post", |
86 | | - "batch_events": false, |
87 | | - } |
88 | | - sinkParams := &EventsV1.CreateSinkParams{} |
89 | | - sinkParams.SetSinkConfiguration(sinkConfig) |
90 | | - sinkParams.SetDescription("test sink") |
91 | | - sinkParams.SetSinkType("webhook") |
92 | | - sink, err := testClient.EventsV1.CreateSink(sinkParams) |
93 | | - assert.Nil(t, err) |
94 | | - assert.NotNil(t, sink) |
95 | | - |
96 | | - types := []map[string]interface{}{ |
97 | | - { |
98 | | - "type": "com.twilio.messaging.message.delivered", |
99 | | - }, |
100 | | - { |
101 | | - "type": "com.twilio.messaging.message.sent", |
102 | | - }, |
103 | | - } |
104 | | - subscriptionsParams := &EventsV1.CreateSubscriptionParams{} |
105 | | - subscriptionsParams.SetSinkSid(*sink.Sid) |
106 | | - subscriptionsParams.SetTypes(types) |
107 | | - subscriptionsParams.SetDescription("test subscription") |
108 | | - subscription, err := testClient.EventsV1.CreateSubscription(subscriptionsParams) |
109 | | - assert.Nil(t, err) |
110 | | - assert.NotNil(t, subscription) |
111 | | - |
112 | | - // Clean up the resources we've created |
113 | | - err = testClient.EventsV1.DeleteSubscription(*subscription.Sid) |
114 | | - assert.Nil(t, err) |
115 | | - err = testClient.EventsV1.DeleteSink(*sink.Sid) |
116 | | - assert.Nil(t, err) |
117 | | -} |
| 81 | +//func TestListParams(t *testing.T) { |
| 82 | +// sinkConfig := map[string]interface{}{ |
| 83 | +// "destination": "http://example.org/webhook", |
| 84 | +// "method": "post", |
| 85 | +// "batch_events": false, |
| 86 | +// } |
| 87 | +// sinkParams := &EventsV1.CreateSinkParams{} |
| 88 | +// sinkParams.SetSinkConfiguration(sinkConfig) |
| 89 | +// sinkParams.SetDescription("test sink") |
| 90 | +// sinkParams.SetSinkType("webhook") |
| 91 | +// sink, err := testClient.EventsV1.CreateSink(sinkParams) |
| 92 | +// assert.Nil(t, err) |
| 93 | +// assert.NotNil(t, sink) |
| 94 | +// |
| 95 | +// types := []map[string]interface{}{ |
| 96 | +// { |
| 97 | +// "type": "com.twilio.messaging.message.delivered", |
| 98 | +// }, |
| 99 | +// { |
| 100 | +// "type": "com.twilio.messaging.message.sent", |
| 101 | +// }, |
| 102 | +// } |
| 103 | +// subscriptionsParams := &EventsV1.CreateSubscriptionParams{} |
| 104 | +// subscriptionsParams.SetSinkSid(*sink.Sid) |
| 105 | +// subscriptionsParams.SetTypes(types) |
| 106 | +// subscriptionsParams.SetDescription("test subscription") |
| 107 | +// subscription, err := testClient.EventsV1.CreateSubscription(subscriptionsParams) |
| 108 | +// assert.Nil(t, err) |
| 109 | +// assert.NotNil(t, subscription) |
| 110 | +// |
| 111 | +// // Clean up the resources we've created |
| 112 | +// err = testClient.EventsV1.DeleteSubscription(*subscription.Sid) |
| 113 | +// assert.Nil(t, err) |
| 114 | +// err = testClient.EventsV1.DeleteSink(*sink.Sid) |
| 115 | +// assert.Nil(t, err) |
| 116 | +//} |
0 commit comments