OLD | NEW |
1 library googleapis_beta.pubsub.v1beta2.test; | 1 library googleapis_beta.pubsub.v1beta2.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
11 | 11 |
12 import 'package:googleapis_beta/pubsub/v1beta2.dart' as api; | 12 import 'package:googleapis_beta/pubsub/v1beta2.dart' as api; |
13 | 13 |
14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 15 core.Function _callback; |
16 core.bool _expectJson; | 16 core.bool _expectJson; |
17 | 17 |
18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 19 _callback = callback; |
20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
(...skipping 18 matching lines...) Expand all Loading... |
39 } else { | 39 } else { |
40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 41 return _callback(request, data); |
42 }); | 42 }); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 buildUnnamed3718() { | 54 buildUnnamed3192() { |
55 var o = new core.List<core.String>(); | 55 var o = new core.List<core.String>(); |
56 o.add("foo"); | 56 o.add("foo"); |
57 o.add("foo"); | 57 o.add("foo"); |
58 return o; | 58 return o; |
59 } | 59 } |
60 | 60 |
61 checkUnnamed3718(core.List<core.String> o) { | 61 checkUnnamed3192(core.List<core.String> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
63 unittest.expect(o[0], unittest.equals('foo')); | 63 unittest.expect(o[0], unittest.equals('foo')); |
64 unittest.expect(o[1], unittest.equals('foo')); | 64 unittest.expect(o[1], unittest.equals('foo')); |
65 } | 65 } |
66 | 66 |
67 core.int buildCounterAcknowledgeRequest = 0; | 67 core.int buildCounterAcknowledgeRequest = 0; |
68 buildAcknowledgeRequest() { | 68 buildAcknowledgeRequest() { |
69 var o = new api.AcknowledgeRequest(); | 69 var o = new api.AcknowledgeRequest(); |
70 buildCounterAcknowledgeRequest++; | 70 buildCounterAcknowledgeRequest++; |
71 if (buildCounterAcknowledgeRequest < 3) { | 71 if (buildCounterAcknowledgeRequest < 3) { |
72 o.ackIds = buildUnnamed3718(); | 72 o.ackIds = buildUnnamed3192(); |
73 } | 73 } |
74 buildCounterAcknowledgeRequest--; | 74 buildCounterAcknowledgeRequest--; |
75 return o; | 75 return o; |
76 } | 76 } |
77 | 77 |
78 checkAcknowledgeRequest(api.AcknowledgeRequest o) { | 78 checkAcknowledgeRequest(api.AcknowledgeRequest o) { |
79 buildCounterAcknowledgeRequest++; | 79 buildCounterAcknowledgeRequest++; |
80 if (buildCounterAcknowledgeRequest < 3) { | 80 if (buildCounterAcknowledgeRequest < 3) { |
81 checkUnnamed3718(o.ackIds); | 81 checkUnnamed3192(o.ackIds); |
82 } | 82 } |
83 buildCounterAcknowledgeRequest--; | 83 buildCounterAcknowledgeRequest--; |
84 } | 84 } |
85 | 85 |
86 buildUnnamed3719() { | 86 buildUnnamed3193() { |
87 var o = new core.List<core.String>(); | 87 var o = new core.List<core.String>(); |
88 o.add("foo"); | 88 o.add("foo"); |
89 o.add("foo"); | 89 o.add("foo"); |
90 return o; | 90 return o; |
91 } | 91 } |
92 | 92 |
93 checkUnnamed3719(core.List<core.String> o) { | 93 checkUnnamed3193(core.List<core.String> o) { |
94 unittest.expect(o, unittest.hasLength(2)); | 94 unittest.expect(o, unittest.hasLength(2)); |
95 unittest.expect(o[0], unittest.equals('foo')); | 95 unittest.expect(o[0], unittest.equals('foo')); |
96 unittest.expect(o[1], unittest.equals('foo')); | 96 unittest.expect(o[1], unittest.equals('foo')); |
97 } | 97 } |
98 | 98 |
99 core.int buildCounterBinding = 0; | 99 core.int buildCounterBinding = 0; |
100 buildBinding() { | 100 buildBinding() { |
101 var o = new api.Binding(); | 101 var o = new api.Binding(); |
102 buildCounterBinding++; | 102 buildCounterBinding++; |
103 if (buildCounterBinding < 3) { | 103 if (buildCounterBinding < 3) { |
104 o.members = buildUnnamed3719(); | 104 o.members = buildUnnamed3193(); |
105 o.role = "foo"; | 105 o.role = "foo"; |
106 } | 106 } |
107 buildCounterBinding--; | 107 buildCounterBinding--; |
108 return o; | 108 return o; |
109 } | 109 } |
110 | 110 |
111 checkBinding(api.Binding o) { | 111 checkBinding(api.Binding o) { |
112 buildCounterBinding++; | 112 buildCounterBinding++; |
113 if (buildCounterBinding < 3) { | 113 if (buildCounterBinding < 3) { |
114 checkUnnamed3719(o.members); | 114 checkUnnamed3193(o.members); |
115 unittest.expect(o.role, unittest.equals('foo')); | 115 unittest.expect(o.role, unittest.equals('foo')); |
116 } | 116 } |
117 buildCounterBinding--; | 117 buildCounterBinding--; |
118 } | 118 } |
119 | 119 |
120 core.int buildCounterEmpty = 0; | 120 core.int buildCounterEmpty = 0; |
121 buildEmpty() { | 121 buildEmpty() { |
122 var o = new api.Empty(); | 122 var o = new api.Empty(); |
123 buildCounterEmpty++; | 123 buildCounterEmpty++; |
124 if (buildCounterEmpty < 3) { | 124 if (buildCounterEmpty < 3) { |
125 } | 125 } |
126 buildCounterEmpty--; | 126 buildCounterEmpty--; |
127 return o; | 127 return o; |
128 } | 128 } |
129 | 129 |
130 checkEmpty(api.Empty o) { | 130 checkEmpty(api.Empty o) { |
131 buildCounterEmpty++; | 131 buildCounterEmpty++; |
132 if (buildCounterEmpty < 3) { | 132 if (buildCounterEmpty < 3) { |
133 } | 133 } |
134 buildCounterEmpty--; | 134 buildCounterEmpty--; |
135 } | 135 } |
136 | 136 |
137 buildUnnamed3720() { | 137 buildUnnamed3194() { |
138 var o = new core.List<api.Subscription>(); | 138 var o = new core.List<api.Subscription>(); |
139 o.add(buildSubscription()); | 139 o.add(buildSubscription()); |
140 o.add(buildSubscription()); | 140 o.add(buildSubscription()); |
141 return o; | 141 return o; |
142 } | 142 } |
143 | 143 |
144 checkUnnamed3720(core.List<api.Subscription> o) { | 144 checkUnnamed3194(core.List<api.Subscription> o) { |
145 unittest.expect(o, unittest.hasLength(2)); | 145 unittest.expect(o, unittest.hasLength(2)); |
146 checkSubscription(o[0]); | 146 checkSubscription(o[0]); |
147 checkSubscription(o[1]); | 147 checkSubscription(o[1]); |
148 } | 148 } |
149 | 149 |
150 core.int buildCounterListSubscriptionsResponse = 0; | 150 core.int buildCounterListSubscriptionsResponse = 0; |
151 buildListSubscriptionsResponse() { | 151 buildListSubscriptionsResponse() { |
152 var o = new api.ListSubscriptionsResponse(); | 152 var o = new api.ListSubscriptionsResponse(); |
153 buildCounterListSubscriptionsResponse++; | 153 buildCounterListSubscriptionsResponse++; |
154 if (buildCounterListSubscriptionsResponse < 3) { | 154 if (buildCounterListSubscriptionsResponse < 3) { |
155 o.nextPageToken = "foo"; | 155 o.nextPageToken = "foo"; |
156 o.subscriptions = buildUnnamed3720(); | 156 o.subscriptions = buildUnnamed3194(); |
157 } | 157 } |
158 buildCounterListSubscriptionsResponse--; | 158 buildCounterListSubscriptionsResponse--; |
159 return o; | 159 return o; |
160 } | 160 } |
161 | 161 |
162 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { | 162 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { |
163 buildCounterListSubscriptionsResponse++; | 163 buildCounterListSubscriptionsResponse++; |
164 if (buildCounterListSubscriptionsResponse < 3) { | 164 if (buildCounterListSubscriptionsResponse < 3) { |
165 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 165 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
166 checkUnnamed3720(o.subscriptions); | 166 checkUnnamed3194(o.subscriptions); |
167 } | 167 } |
168 buildCounterListSubscriptionsResponse--; | 168 buildCounterListSubscriptionsResponse--; |
169 } | 169 } |
170 | 170 |
171 buildUnnamed3721() { | 171 buildUnnamed3195() { |
172 var o = new core.List<core.String>(); | 172 var o = new core.List<core.String>(); |
173 o.add("foo"); | 173 o.add("foo"); |
174 o.add("foo"); | 174 o.add("foo"); |
175 return o; | 175 return o; |
176 } | 176 } |
177 | 177 |
178 checkUnnamed3721(core.List<core.String> o) { | 178 checkUnnamed3195(core.List<core.String> o) { |
179 unittest.expect(o, unittest.hasLength(2)); | 179 unittest.expect(o, unittest.hasLength(2)); |
180 unittest.expect(o[0], unittest.equals('foo')); | 180 unittest.expect(o[0], unittest.equals('foo')); |
181 unittest.expect(o[1], unittest.equals('foo')); | 181 unittest.expect(o[1], unittest.equals('foo')); |
182 } | 182 } |
183 | 183 |
184 core.int buildCounterListTopicSubscriptionsResponse = 0; | 184 core.int buildCounterListTopicSubscriptionsResponse = 0; |
185 buildListTopicSubscriptionsResponse() { | 185 buildListTopicSubscriptionsResponse() { |
186 var o = new api.ListTopicSubscriptionsResponse(); | 186 var o = new api.ListTopicSubscriptionsResponse(); |
187 buildCounterListTopicSubscriptionsResponse++; | 187 buildCounterListTopicSubscriptionsResponse++; |
188 if (buildCounterListTopicSubscriptionsResponse < 3) { | 188 if (buildCounterListTopicSubscriptionsResponse < 3) { |
189 o.nextPageToken = "foo"; | 189 o.nextPageToken = "foo"; |
190 o.subscriptions = buildUnnamed3721(); | 190 o.subscriptions = buildUnnamed3195(); |
191 } | 191 } |
192 buildCounterListTopicSubscriptionsResponse--; | 192 buildCounterListTopicSubscriptionsResponse--; |
193 return o; | 193 return o; |
194 } | 194 } |
195 | 195 |
196 checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) { | 196 checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) { |
197 buildCounterListTopicSubscriptionsResponse++; | 197 buildCounterListTopicSubscriptionsResponse++; |
198 if (buildCounterListTopicSubscriptionsResponse < 3) { | 198 if (buildCounterListTopicSubscriptionsResponse < 3) { |
199 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 199 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
200 checkUnnamed3721(o.subscriptions); | 200 checkUnnamed3195(o.subscriptions); |
201 } | 201 } |
202 buildCounterListTopicSubscriptionsResponse--; | 202 buildCounterListTopicSubscriptionsResponse--; |
203 } | 203 } |
204 | 204 |
205 buildUnnamed3722() { | 205 buildUnnamed3196() { |
206 var o = new core.List<api.Topic>(); | 206 var o = new core.List<api.Topic>(); |
207 o.add(buildTopic()); | 207 o.add(buildTopic()); |
208 o.add(buildTopic()); | 208 o.add(buildTopic()); |
209 return o; | 209 return o; |
210 } | 210 } |
211 | 211 |
212 checkUnnamed3722(core.List<api.Topic> o) { | 212 checkUnnamed3196(core.List<api.Topic> o) { |
213 unittest.expect(o, unittest.hasLength(2)); | 213 unittest.expect(o, unittest.hasLength(2)); |
214 checkTopic(o[0]); | 214 checkTopic(o[0]); |
215 checkTopic(o[1]); | 215 checkTopic(o[1]); |
216 } | 216 } |
217 | 217 |
218 core.int buildCounterListTopicsResponse = 0; | 218 core.int buildCounterListTopicsResponse = 0; |
219 buildListTopicsResponse() { | 219 buildListTopicsResponse() { |
220 var o = new api.ListTopicsResponse(); | 220 var o = new api.ListTopicsResponse(); |
221 buildCounterListTopicsResponse++; | 221 buildCounterListTopicsResponse++; |
222 if (buildCounterListTopicsResponse < 3) { | 222 if (buildCounterListTopicsResponse < 3) { |
223 o.nextPageToken = "foo"; | 223 o.nextPageToken = "foo"; |
224 o.topics = buildUnnamed3722(); | 224 o.topics = buildUnnamed3196(); |
225 } | 225 } |
226 buildCounterListTopicsResponse--; | 226 buildCounterListTopicsResponse--; |
227 return o; | 227 return o; |
228 } | 228 } |
229 | 229 |
230 checkListTopicsResponse(api.ListTopicsResponse o) { | 230 checkListTopicsResponse(api.ListTopicsResponse o) { |
231 buildCounterListTopicsResponse++; | 231 buildCounterListTopicsResponse++; |
232 if (buildCounterListTopicsResponse < 3) { | 232 if (buildCounterListTopicsResponse < 3) { |
233 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 233 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
234 checkUnnamed3722(o.topics); | 234 checkUnnamed3196(o.topics); |
235 } | 235 } |
236 buildCounterListTopicsResponse--; | 236 buildCounterListTopicsResponse--; |
237 } | 237 } |
238 | 238 |
239 buildUnnamed3723() { | 239 buildUnnamed3197() { |
240 var o = new core.List<core.String>(); | 240 var o = new core.List<core.String>(); |
241 o.add("foo"); | 241 o.add("foo"); |
242 o.add("foo"); | 242 o.add("foo"); |
243 return o; | 243 return o; |
244 } | 244 } |
245 | 245 |
246 checkUnnamed3723(core.List<core.String> o) { | 246 checkUnnamed3197(core.List<core.String> o) { |
247 unittest.expect(o, unittest.hasLength(2)); | 247 unittest.expect(o, unittest.hasLength(2)); |
248 unittest.expect(o[0], unittest.equals('foo')); | 248 unittest.expect(o[0], unittest.equals('foo')); |
249 unittest.expect(o[1], unittest.equals('foo')); | 249 unittest.expect(o[1], unittest.equals('foo')); |
250 } | 250 } |
251 | 251 |
252 core.int buildCounterModifyAckDeadlineRequest = 0; | 252 core.int buildCounterModifyAckDeadlineRequest = 0; |
253 buildModifyAckDeadlineRequest() { | 253 buildModifyAckDeadlineRequest() { |
254 var o = new api.ModifyAckDeadlineRequest(); | 254 var o = new api.ModifyAckDeadlineRequest(); |
255 buildCounterModifyAckDeadlineRequest++; | 255 buildCounterModifyAckDeadlineRequest++; |
256 if (buildCounterModifyAckDeadlineRequest < 3) { | 256 if (buildCounterModifyAckDeadlineRequest < 3) { |
257 o.ackDeadlineSeconds = 42; | 257 o.ackDeadlineSeconds = 42; |
258 o.ackId = "foo"; | 258 o.ackId = "foo"; |
259 o.ackIds = buildUnnamed3723(); | 259 o.ackIds = buildUnnamed3197(); |
260 } | 260 } |
261 buildCounterModifyAckDeadlineRequest--; | 261 buildCounterModifyAckDeadlineRequest--; |
262 return o; | 262 return o; |
263 } | 263 } |
264 | 264 |
265 checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) { | 265 checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) { |
266 buildCounterModifyAckDeadlineRequest++; | 266 buildCounterModifyAckDeadlineRequest++; |
267 if (buildCounterModifyAckDeadlineRequest < 3) { | 267 if (buildCounterModifyAckDeadlineRequest < 3) { |
268 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); | 268 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); |
269 unittest.expect(o.ackId, unittest.equals('foo')); | 269 unittest.expect(o.ackId, unittest.equals('foo')); |
270 checkUnnamed3723(o.ackIds); | 270 checkUnnamed3197(o.ackIds); |
271 } | 271 } |
272 buildCounterModifyAckDeadlineRequest--; | 272 buildCounterModifyAckDeadlineRequest--; |
273 } | 273 } |
274 | 274 |
275 core.int buildCounterModifyPushConfigRequest = 0; | 275 core.int buildCounterModifyPushConfigRequest = 0; |
276 buildModifyPushConfigRequest() { | 276 buildModifyPushConfigRequest() { |
277 var o = new api.ModifyPushConfigRequest(); | 277 var o = new api.ModifyPushConfigRequest(); |
278 buildCounterModifyPushConfigRequest++; | 278 buildCounterModifyPushConfigRequest++; |
279 if (buildCounterModifyPushConfigRequest < 3) { | 279 if (buildCounterModifyPushConfigRequest < 3) { |
280 o.pushConfig = buildPushConfig(); | 280 o.pushConfig = buildPushConfig(); |
281 } | 281 } |
282 buildCounterModifyPushConfigRequest--; | 282 buildCounterModifyPushConfigRequest--; |
283 return o; | 283 return o; |
284 } | 284 } |
285 | 285 |
286 checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) { | 286 checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) { |
287 buildCounterModifyPushConfigRequest++; | 287 buildCounterModifyPushConfigRequest++; |
288 if (buildCounterModifyPushConfigRequest < 3) { | 288 if (buildCounterModifyPushConfigRequest < 3) { |
289 checkPushConfig(o.pushConfig); | 289 checkPushConfig(o.pushConfig); |
290 } | 290 } |
291 buildCounterModifyPushConfigRequest--; | 291 buildCounterModifyPushConfigRequest--; |
292 } | 292 } |
293 | 293 |
294 buildUnnamed3724() { | 294 buildUnnamed3198() { |
295 var o = new core.List<api.Binding>(); | 295 var o = new core.List<api.Binding>(); |
296 o.add(buildBinding()); | 296 o.add(buildBinding()); |
297 o.add(buildBinding()); | 297 o.add(buildBinding()); |
298 return o; | 298 return o; |
299 } | 299 } |
300 | 300 |
301 checkUnnamed3724(core.List<api.Binding> o) { | 301 checkUnnamed3198(core.List<api.Binding> o) { |
302 unittest.expect(o, unittest.hasLength(2)); | 302 unittest.expect(o, unittest.hasLength(2)); |
303 checkBinding(o[0]); | 303 checkBinding(o[0]); |
304 checkBinding(o[1]); | 304 checkBinding(o[1]); |
305 } | 305 } |
306 | 306 |
307 core.int buildCounterPolicy = 0; | 307 core.int buildCounterPolicy = 0; |
308 buildPolicy() { | 308 buildPolicy() { |
309 var o = new api.Policy(); | 309 var o = new api.Policy(); |
310 buildCounterPolicy++; | 310 buildCounterPolicy++; |
311 if (buildCounterPolicy < 3) { | 311 if (buildCounterPolicy < 3) { |
312 o.bindings = buildUnnamed3724(); | 312 o.bindings = buildUnnamed3198(); |
313 o.etag = "foo"; | 313 o.etag = "foo"; |
314 o.version = 42; | 314 o.version = 42; |
315 } | 315 } |
316 buildCounterPolicy--; | 316 buildCounterPolicy--; |
317 return o; | 317 return o; |
318 } | 318 } |
319 | 319 |
320 checkPolicy(api.Policy o) { | 320 checkPolicy(api.Policy o) { |
321 buildCounterPolicy++; | 321 buildCounterPolicy++; |
322 if (buildCounterPolicy < 3) { | 322 if (buildCounterPolicy < 3) { |
323 checkUnnamed3724(o.bindings); | 323 checkUnnamed3198(o.bindings); |
324 unittest.expect(o.etag, unittest.equals('foo')); | 324 unittest.expect(o.etag, unittest.equals('foo')); |
325 unittest.expect(o.version, unittest.equals(42)); | 325 unittest.expect(o.version, unittest.equals(42)); |
326 } | 326 } |
327 buildCounterPolicy--; | 327 buildCounterPolicy--; |
328 } | 328 } |
329 | 329 |
330 buildUnnamed3725() { | 330 buildUnnamed3199() { |
331 var o = new core.List<api.PubsubMessage>(); | 331 var o = new core.List<api.PubsubMessage>(); |
332 o.add(buildPubsubMessage()); | 332 o.add(buildPubsubMessage()); |
333 o.add(buildPubsubMessage()); | 333 o.add(buildPubsubMessage()); |
334 return o; | 334 return o; |
335 } | 335 } |
336 | 336 |
337 checkUnnamed3725(core.List<api.PubsubMessage> o) { | 337 checkUnnamed3199(core.List<api.PubsubMessage> o) { |
338 unittest.expect(o, unittest.hasLength(2)); | 338 unittest.expect(o, unittest.hasLength(2)); |
339 checkPubsubMessage(o[0]); | 339 checkPubsubMessage(o[0]); |
340 checkPubsubMessage(o[1]); | 340 checkPubsubMessage(o[1]); |
341 } | 341 } |
342 | 342 |
343 core.int buildCounterPublishRequest = 0; | 343 core.int buildCounterPublishRequest = 0; |
344 buildPublishRequest() { | 344 buildPublishRequest() { |
345 var o = new api.PublishRequest(); | 345 var o = new api.PublishRequest(); |
346 buildCounterPublishRequest++; | 346 buildCounterPublishRequest++; |
347 if (buildCounterPublishRequest < 3) { | 347 if (buildCounterPublishRequest < 3) { |
348 o.messages = buildUnnamed3725(); | 348 o.messages = buildUnnamed3199(); |
349 } | 349 } |
350 buildCounterPublishRequest--; | 350 buildCounterPublishRequest--; |
351 return o; | 351 return o; |
352 } | 352 } |
353 | 353 |
354 checkPublishRequest(api.PublishRequest o) { | 354 checkPublishRequest(api.PublishRequest o) { |
355 buildCounterPublishRequest++; | 355 buildCounterPublishRequest++; |
356 if (buildCounterPublishRequest < 3) { | 356 if (buildCounterPublishRequest < 3) { |
357 checkUnnamed3725(o.messages); | 357 checkUnnamed3199(o.messages); |
358 } | 358 } |
359 buildCounterPublishRequest--; | 359 buildCounterPublishRequest--; |
360 } | 360 } |
361 | 361 |
362 buildUnnamed3726() { | 362 buildUnnamed3200() { |
363 var o = new core.List<core.String>(); | 363 var o = new core.List<core.String>(); |
364 o.add("foo"); | 364 o.add("foo"); |
365 o.add("foo"); | 365 o.add("foo"); |
366 return o; | 366 return o; |
367 } | 367 } |
368 | 368 |
369 checkUnnamed3726(core.List<core.String> o) { | 369 checkUnnamed3200(core.List<core.String> o) { |
370 unittest.expect(o, unittest.hasLength(2)); | 370 unittest.expect(o, unittest.hasLength(2)); |
371 unittest.expect(o[0], unittest.equals('foo')); | 371 unittest.expect(o[0], unittest.equals('foo')); |
372 unittest.expect(o[1], unittest.equals('foo')); | 372 unittest.expect(o[1], unittest.equals('foo')); |
373 } | 373 } |
374 | 374 |
375 core.int buildCounterPublishResponse = 0; | 375 core.int buildCounterPublishResponse = 0; |
376 buildPublishResponse() { | 376 buildPublishResponse() { |
377 var o = new api.PublishResponse(); | 377 var o = new api.PublishResponse(); |
378 buildCounterPublishResponse++; | 378 buildCounterPublishResponse++; |
379 if (buildCounterPublishResponse < 3) { | 379 if (buildCounterPublishResponse < 3) { |
380 o.messageIds = buildUnnamed3726(); | 380 o.messageIds = buildUnnamed3200(); |
381 } | 381 } |
382 buildCounterPublishResponse--; | 382 buildCounterPublishResponse--; |
383 return o; | 383 return o; |
384 } | 384 } |
385 | 385 |
386 checkPublishResponse(api.PublishResponse o) { | 386 checkPublishResponse(api.PublishResponse o) { |
387 buildCounterPublishResponse++; | 387 buildCounterPublishResponse++; |
388 if (buildCounterPublishResponse < 3) { | 388 if (buildCounterPublishResponse < 3) { |
389 checkUnnamed3726(o.messageIds); | 389 checkUnnamed3200(o.messageIds); |
390 } | 390 } |
391 buildCounterPublishResponse--; | 391 buildCounterPublishResponse--; |
392 } | 392 } |
393 | 393 |
394 buildUnnamed3727() { | 394 buildUnnamed3201() { |
395 var o = new core.Map<core.String, core.String>(); | 395 var o = new core.Map<core.String, core.String>(); |
396 o["x"] = "foo"; | 396 o["x"] = "foo"; |
397 o["y"] = "foo"; | 397 o["y"] = "foo"; |
398 return o; | 398 return o; |
399 } | 399 } |
400 | 400 |
401 checkUnnamed3727(core.Map<core.String, core.String> o) { | 401 checkUnnamed3201(core.Map<core.String, core.String> o) { |
402 unittest.expect(o, unittest.hasLength(2)); | 402 unittest.expect(o, unittest.hasLength(2)); |
403 unittest.expect(o["x"], unittest.equals('foo')); | 403 unittest.expect(o["x"], unittest.equals('foo')); |
404 unittest.expect(o["y"], unittest.equals('foo')); | 404 unittest.expect(o["y"], unittest.equals('foo')); |
405 } | 405 } |
406 | 406 |
407 core.int buildCounterPubsubMessage = 0; | 407 core.int buildCounterPubsubMessage = 0; |
408 buildPubsubMessage() { | 408 buildPubsubMessage() { |
409 var o = new api.PubsubMessage(); | 409 var o = new api.PubsubMessage(); |
410 buildCounterPubsubMessage++; | 410 buildCounterPubsubMessage++; |
411 if (buildCounterPubsubMessage < 3) { | 411 if (buildCounterPubsubMessage < 3) { |
412 o.attributes = buildUnnamed3727(); | 412 o.attributes = buildUnnamed3201(); |
413 o.data = "foo"; | 413 o.data = "foo"; |
414 o.messageId = "foo"; | 414 o.messageId = "foo"; |
415 o.publishTime = "foo"; | 415 o.publishTime = "foo"; |
416 } | 416 } |
417 buildCounterPubsubMessage--; | 417 buildCounterPubsubMessage--; |
418 return o; | 418 return o; |
419 } | 419 } |
420 | 420 |
421 checkPubsubMessage(api.PubsubMessage o) { | 421 checkPubsubMessage(api.PubsubMessage o) { |
422 buildCounterPubsubMessage++; | 422 buildCounterPubsubMessage++; |
423 if (buildCounterPubsubMessage < 3) { | 423 if (buildCounterPubsubMessage < 3) { |
424 checkUnnamed3727(o.attributes); | 424 checkUnnamed3201(o.attributes); |
425 unittest.expect(o.data, unittest.equals('foo')); | 425 unittest.expect(o.data, unittest.equals('foo')); |
426 unittest.expect(o.messageId, unittest.equals('foo')); | 426 unittest.expect(o.messageId, unittest.equals('foo')); |
427 unittest.expect(o.publishTime, unittest.equals('foo')); | 427 unittest.expect(o.publishTime, unittest.equals('foo')); |
428 } | 428 } |
429 buildCounterPubsubMessage--; | 429 buildCounterPubsubMessage--; |
430 } | 430 } |
431 | 431 |
432 core.int buildCounterPullRequest = 0; | 432 core.int buildCounterPullRequest = 0; |
433 buildPullRequest() { | 433 buildPullRequest() { |
434 var o = new api.PullRequest(); | 434 var o = new api.PullRequest(); |
435 buildCounterPullRequest++; | 435 buildCounterPullRequest++; |
436 if (buildCounterPullRequest < 3) { | 436 if (buildCounterPullRequest < 3) { |
437 o.maxMessages = 42; | 437 o.maxMessages = 42; |
438 o.returnImmediately = true; | 438 o.returnImmediately = true; |
439 } | 439 } |
440 buildCounterPullRequest--; | 440 buildCounterPullRequest--; |
441 return o; | 441 return o; |
442 } | 442 } |
443 | 443 |
444 checkPullRequest(api.PullRequest o) { | 444 checkPullRequest(api.PullRequest o) { |
445 buildCounterPullRequest++; | 445 buildCounterPullRequest++; |
446 if (buildCounterPullRequest < 3) { | 446 if (buildCounterPullRequest < 3) { |
447 unittest.expect(o.maxMessages, unittest.equals(42)); | 447 unittest.expect(o.maxMessages, unittest.equals(42)); |
448 unittest.expect(o.returnImmediately, unittest.isTrue); | 448 unittest.expect(o.returnImmediately, unittest.isTrue); |
449 } | 449 } |
450 buildCounterPullRequest--; | 450 buildCounterPullRequest--; |
451 } | 451 } |
452 | 452 |
453 buildUnnamed3728() { | 453 buildUnnamed3202() { |
454 var o = new core.List<api.ReceivedMessage>(); | 454 var o = new core.List<api.ReceivedMessage>(); |
455 o.add(buildReceivedMessage()); | 455 o.add(buildReceivedMessage()); |
456 o.add(buildReceivedMessage()); | 456 o.add(buildReceivedMessage()); |
457 return o; | 457 return o; |
458 } | 458 } |
459 | 459 |
460 checkUnnamed3728(core.List<api.ReceivedMessage> o) { | 460 checkUnnamed3202(core.List<api.ReceivedMessage> o) { |
461 unittest.expect(o, unittest.hasLength(2)); | 461 unittest.expect(o, unittest.hasLength(2)); |
462 checkReceivedMessage(o[0]); | 462 checkReceivedMessage(o[0]); |
463 checkReceivedMessage(o[1]); | 463 checkReceivedMessage(o[1]); |
464 } | 464 } |
465 | 465 |
466 core.int buildCounterPullResponse = 0; | 466 core.int buildCounterPullResponse = 0; |
467 buildPullResponse() { | 467 buildPullResponse() { |
468 var o = new api.PullResponse(); | 468 var o = new api.PullResponse(); |
469 buildCounterPullResponse++; | 469 buildCounterPullResponse++; |
470 if (buildCounterPullResponse < 3) { | 470 if (buildCounterPullResponse < 3) { |
471 o.receivedMessages = buildUnnamed3728(); | 471 o.receivedMessages = buildUnnamed3202(); |
472 } | 472 } |
473 buildCounterPullResponse--; | 473 buildCounterPullResponse--; |
474 return o; | 474 return o; |
475 } | 475 } |
476 | 476 |
477 checkPullResponse(api.PullResponse o) { | 477 checkPullResponse(api.PullResponse o) { |
478 buildCounterPullResponse++; | 478 buildCounterPullResponse++; |
479 if (buildCounterPullResponse < 3) { | 479 if (buildCounterPullResponse < 3) { |
480 checkUnnamed3728(o.receivedMessages); | 480 checkUnnamed3202(o.receivedMessages); |
481 } | 481 } |
482 buildCounterPullResponse--; | 482 buildCounterPullResponse--; |
483 } | 483 } |
484 | 484 |
485 buildUnnamed3729() { | 485 buildUnnamed3203() { |
486 var o = new core.Map<core.String, core.String>(); | 486 var o = new core.Map<core.String, core.String>(); |
487 o["x"] = "foo"; | 487 o["x"] = "foo"; |
488 o["y"] = "foo"; | 488 o["y"] = "foo"; |
489 return o; | 489 return o; |
490 } | 490 } |
491 | 491 |
492 checkUnnamed3729(core.Map<core.String, core.String> o) { | 492 checkUnnamed3203(core.Map<core.String, core.String> o) { |
493 unittest.expect(o, unittest.hasLength(2)); | 493 unittest.expect(o, unittest.hasLength(2)); |
494 unittest.expect(o["x"], unittest.equals('foo')); | 494 unittest.expect(o["x"], unittest.equals('foo')); |
495 unittest.expect(o["y"], unittest.equals('foo')); | 495 unittest.expect(o["y"], unittest.equals('foo')); |
496 } | 496 } |
497 | 497 |
498 core.int buildCounterPushConfig = 0; | 498 core.int buildCounterPushConfig = 0; |
499 buildPushConfig() { | 499 buildPushConfig() { |
500 var o = new api.PushConfig(); | 500 var o = new api.PushConfig(); |
501 buildCounterPushConfig++; | 501 buildCounterPushConfig++; |
502 if (buildCounterPushConfig < 3) { | 502 if (buildCounterPushConfig < 3) { |
503 o.attributes = buildUnnamed3729(); | 503 o.attributes = buildUnnamed3203(); |
504 o.pushEndpoint = "foo"; | 504 o.pushEndpoint = "foo"; |
505 } | 505 } |
506 buildCounterPushConfig--; | 506 buildCounterPushConfig--; |
507 return o; | 507 return o; |
508 } | 508 } |
509 | 509 |
510 checkPushConfig(api.PushConfig o) { | 510 checkPushConfig(api.PushConfig o) { |
511 buildCounterPushConfig++; | 511 buildCounterPushConfig++; |
512 if (buildCounterPushConfig < 3) { | 512 if (buildCounterPushConfig < 3) { |
513 checkUnnamed3729(o.attributes); | 513 checkUnnamed3203(o.attributes); |
514 unittest.expect(o.pushEndpoint, unittest.equals('foo')); | 514 unittest.expect(o.pushEndpoint, unittest.equals('foo')); |
515 } | 515 } |
516 buildCounterPushConfig--; | 516 buildCounterPushConfig--; |
517 } | 517 } |
518 | 518 |
519 core.int buildCounterReceivedMessage = 0; | 519 core.int buildCounterReceivedMessage = 0; |
520 buildReceivedMessage() { | 520 buildReceivedMessage() { |
521 var o = new api.ReceivedMessage(); | 521 var o = new api.ReceivedMessage(); |
522 buildCounterReceivedMessage++; | 522 buildCounterReceivedMessage++; |
523 if (buildCounterReceivedMessage < 3) { | 523 if (buildCounterReceivedMessage < 3) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 buildCounterSubscription++; | 574 buildCounterSubscription++; |
575 if (buildCounterSubscription < 3) { | 575 if (buildCounterSubscription < 3) { |
576 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); | 576 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); |
577 unittest.expect(o.name, unittest.equals('foo')); | 577 unittest.expect(o.name, unittest.equals('foo')); |
578 checkPushConfig(o.pushConfig); | 578 checkPushConfig(o.pushConfig); |
579 unittest.expect(o.topic, unittest.equals('foo')); | 579 unittest.expect(o.topic, unittest.equals('foo')); |
580 } | 580 } |
581 buildCounterSubscription--; | 581 buildCounterSubscription--; |
582 } | 582 } |
583 | 583 |
584 buildUnnamed3730() { | 584 buildUnnamed3204() { |
585 var o = new core.List<core.String>(); | 585 var o = new core.List<core.String>(); |
586 o.add("foo"); | 586 o.add("foo"); |
587 o.add("foo"); | 587 o.add("foo"); |
588 return o; | 588 return o; |
589 } | 589 } |
590 | 590 |
591 checkUnnamed3730(core.List<core.String> o) { | 591 checkUnnamed3204(core.List<core.String> o) { |
592 unittest.expect(o, unittest.hasLength(2)); | 592 unittest.expect(o, unittest.hasLength(2)); |
593 unittest.expect(o[0], unittest.equals('foo')); | 593 unittest.expect(o[0], unittest.equals('foo')); |
594 unittest.expect(o[1], unittest.equals('foo')); | 594 unittest.expect(o[1], unittest.equals('foo')); |
595 } | 595 } |
596 | 596 |
597 core.int buildCounterTestIamPermissionsRequest = 0; | 597 core.int buildCounterTestIamPermissionsRequest = 0; |
598 buildTestIamPermissionsRequest() { | 598 buildTestIamPermissionsRequest() { |
599 var o = new api.TestIamPermissionsRequest(); | 599 var o = new api.TestIamPermissionsRequest(); |
600 buildCounterTestIamPermissionsRequest++; | 600 buildCounterTestIamPermissionsRequest++; |
601 if (buildCounterTestIamPermissionsRequest < 3) { | 601 if (buildCounterTestIamPermissionsRequest < 3) { |
602 o.permissions = buildUnnamed3730(); | 602 o.permissions = buildUnnamed3204(); |
603 } | 603 } |
604 buildCounterTestIamPermissionsRequest--; | 604 buildCounterTestIamPermissionsRequest--; |
605 return o; | 605 return o; |
606 } | 606 } |
607 | 607 |
608 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 608 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
609 buildCounterTestIamPermissionsRequest++; | 609 buildCounterTestIamPermissionsRequest++; |
610 if (buildCounterTestIamPermissionsRequest < 3) { | 610 if (buildCounterTestIamPermissionsRequest < 3) { |
611 checkUnnamed3730(o.permissions); | 611 checkUnnamed3204(o.permissions); |
612 } | 612 } |
613 buildCounterTestIamPermissionsRequest--; | 613 buildCounterTestIamPermissionsRequest--; |
614 } | 614 } |
615 | 615 |
616 buildUnnamed3731() { | 616 buildUnnamed3205() { |
617 var o = new core.List<core.String>(); | 617 var o = new core.List<core.String>(); |
618 o.add("foo"); | 618 o.add("foo"); |
619 o.add("foo"); | 619 o.add("foo"); |
620 return o; | 620 return o; |
621 } | 621 } |
622 | 622 |
623 checkUnnamed3731(core.List<core.String> o) { | 623 checkUnnamed3205(core.List<core.String> o) { |
624 unittest.expect(o, unittest.hasLength(2)); | 624 unittest.expect(o, unittest.hasLength(2)); |
625 unittest.expect(o[0], unittest.equals('foo')); | 625 unittest.expect(o[0], unittest.equals('foo')); |
626 unittest.expect(o[1], unittest.equals('foo')); | 626 unittest.expect(o[1], unittest.equals('foo')); |
627 } | 627 } |
628 | 628 |
629 core.int buildCounterTestIamPermissionsResponse = 0; | 629 core.int buildCounterTestIamPermissionsResponse = 0; |
630 buildTestIamPermissionsResponse() { | 630 buildTestIamPermissionsResponse() { |
631 var o = new api.TestIamPermissionsResponse(); | 631 var o = new api.TestIamPermissionsResponse(); |
632 buildCounterTestIamPermissionsResponse++; | 632 buildCounterTestIamPermissionsResponse++; |
633 if (buildCounterTestIamPermissionsResponse < 3) { | 633 if (buildCounterTestIamPermissionsResponse < 3) { |
634 o.permissions = buildUnnamed3731(); | 634 o.permissions = buildUnnamed3205(); |
635 } | 635 } |
636 buildCounterTestIamPermissionsResponse--; | 636 buildCounterTestIamPermissionsResponse--; |
637 return o; | 637 return o; |
638 } | 638 } |
639 | 639 |
640 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 640 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
641 buildCounterTestIamPermissionsResponse++; | 641 buildCounterTestIamPermissionsResponse++; |
642 if (buildCounterTestIamPermissionsResponse < 3) { | 642 if (buildCounterTestIamPermissionsResponse < 3) { |
643 checkUnnamed3731(o.permissions); | 643 checkUnnamed3205(o.permissions); |
644 } | 644 } |
645 buildCounterTestIamPermissionsResponse--; | 645 buildCounterTestIamPermissionsResponse--; |
646 } | 646 } |
647 | 647 |
648 core.int buildCounterTopic = 0; | 648 core.int buildCounterTopic = 0; |
649 buildTopic() { | 649 buildTopic() { |
650 var o = new api.Topic(); | 650 var o = new api.Topic(); |
651 buildCounterTopic++; | 651 buildCounterTopic++; |
652 if (buildCounterTopic < 3) { | 652 if (buildCounterTopic < 3) { |
653 o.name = "foo"; | 653 o.name = "foo"; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 }); | 855 }); |
856 | 856 |
857 | 857 |
858 unittest.group("resource-ProjectsSubscriptionsResourceApi", () { | 858 unittest.group("resource-ProjectsSubscriptionsResourceApi", () { |
859 unittest.test("method--acknowledge", () { | 859 unittest.test("method--acknowledge", () { |
860 | 860 |
861 var mock = new HttpServerMock(); | 861 var mock = new HttpServerMock(); |
862 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 862 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
863 var arg_request = buildAcknowledgeRequest(); | 863 var arg_request = buildAcknowledgeRequest(); |
864 var arg_subscription = "foo"; | 864 var arg_subscription = "foo"; |
865 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 865 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
866 var obj = new api.AcknowledgeRequest.fromJson(json); | 866 var obj = new api.AcknowledgeRequest.fromJson(json); |
867 checkAcknowledgeRequest(obj); | 867 checkAcknowledgeRequest(obj); |
868 | 868 |
869 var path = (req.url).path; | 869 var path = (req.url).path; |
870 var pathOffset = 0; | 870 var pathOffset = 0; |
871 var index; | 871 var index; |
872 var subPart; | 872 var subPart; |
873 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 873 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
874 pathOffset += 1; | 874 pathOffset += 1; |
875 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 875 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
893 } | 893 } |
894 } | 894 } |
895 | 895 |
896 | 896 |
897 var h = { | 897 var h = { |
898 "content-type" : "application/json; charset=utf-8", | 898 "content-type" : "application/json; charset=utf-8", |
899 }; | 899 }; |
900 var resp = convert.JSON.encode(buildEmpty()); | 900 var resp = convert.JSON.encode(buildEmpty()); |
901 return new async.Future.value(stringResponse(200, h, resp)); | 901 return new async.Future.value(stringResponse(200, h, resp)); |
902 }), true); | 902 }), true); |
903 res.acknowledge(arg_request, arg_subscription).then(unittest.expectAsync((
(api.Empty response) { | 903 res.acknowledge(arg_request, arg_subscription).then(unittest.expectAsync1(
((api.Empty response) { |
904 checkEmpty(response); | 904 checkEmpty(response); |
905 }))); | 905 }))); |
906 }); | 906 }); |
907 | 907 |
908 unittest.test("method--create", () { | 908 unittest.test("method--create", () { |
909 | 909 |
910 var mock = new HttpServerMock(); | 910 var mock = new HttpServerMock(); |
911 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 911 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
912 var arg_request = buildSubscription(); | 912 var arg_request = buildSubscription(); |
913 var arg_name = "foo"; | 913 var arg_name = "foo"; |
914 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 914 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
915 var obj = new api.Subscription.fromJson(json); | 915 var obj = new api.Subscription.fromJson(json); |
916 checkSubscription(obj); | 916 checkSubscription(obj); |
917 | 917 |
918 var path = (req.url).path; | 918 var path = (req.url).path; |
919 var pathOffset = 0; | 919 var pathOffset = 0; |
920 var index; | 920 var index; |
921 var subPart; | 921 var subPart; |
922 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 922 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
923 pathOffset += 1; | 923 pathOffset += 1; |
924 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 924 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
942 } | 942 } |
943 } | 943 } |
944 | 944 |
945 | 945 |
946 var h = { | 946 var h = { |
947 "content-type" : "application/json; charset=utf-8", | 947 "content-type" : "application/json; charset=utf-8", |
948 }; | 948 }; |
949 var resp = convert.JSON.encode(buildSubscription()); | 949 var resp = convert.JSON.encode(buildSubscription()); |
950 return new async.Future.value(stringResponse(200, h, resp)); | 950 return new async.Future.value(stringResponse(200, h, resp)); |
951 }), true); | 951 }), true); |
952 res.create(arg_request, arg_name).then(unittest.expectAsync(((api.Subscrip
tion response) { | 952 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Subscri
ption response) { |
953 checkSubscription(response); | 953 checkSubscription(response); |
954 }))); | 954 }))); |
955 }); | 955 }); |
956 | 956 |
957 unittest.test("method--delete", () { | 957 unittest.test("method--delete", () { |
958 | 958 |
959 var mock = new HttpServerMock(); | 959 var mock = new HttpServerMock(); |
960 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 960 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
961 var arg_subscription = "foo"; | 961 var arg_subscription = "foo"; |
962 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 962 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
963 var path = (req.url).path; | 963 var path = (req.url).path; |
964 var pathOffset = 0; | 964 var pathOffset = 0; |
965 var index; | 965 var index; |
966 var subPart; | 966 var subPart; |
967 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 967 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
968 pathOffset += 1; | 968 pathOffset += 1; |
969 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 969 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
970 pathOffset += 8; | 970 pathOffset += 8; |
971 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 971 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
972 | 972 |
(...skipping 14 matching lines...) Expand all Loading... |
987 } | 987 } |
988 } | 988 } |
989 | 989 |
990 | 990 |
991 var h = { | 991 var h = { |
992 "content-type" : "application/json; charset=utf-8", | 992 "content-type" : "application/json; charset=utf-8", |
993 }; | 993 }; |
994 var resp = convert.JSON.encode(buildEmpty()); | 994 var resp = convert.JSON.encode(buildEmpty()); |
995 return new async.Future.value(stringResponse(200, h, resp)); | 995 return new async.Future.value(stringResponse(200, h, resp)); |
996 }), true); | 996 }), true); |
997 res.delete(arg_subscription).then(unittest.expectAsync(((api.Empty respons
e) { | 997 res.delete(arg_subscription).then(unittest.expectAsync1(((api.Empty respon
se) { |
998 checkEmpty(response); | 998 checkEmpty(response); |
999 }))); | 999 }))); |
1000 }); | 1000 }); |
1001 | 1001 |
1002 unittest.test("method--get", () { | 1002 unittest.test("method--get", () { |
1003 | 1003 |
1004 var mock = new HttpServerMock(); | 1004 var mock = new HttpServerMock(); |
1005 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1005 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1006 var arg_subscription = "foo"; | 1006 var arg_subscription = "foo"; |
1007 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1007 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1008 var path = (req.url).path; | 1008 var path = (req.url).path; |
1009 var pathOffset = 0; | 1009 var pathOffset = 0; |
1010 var index; | 1010 var index; |
1011 var subPart; | 1011 var subPart; |
1012 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1012 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1013 pathOffset += 1; | 1013 pathOffset += 1; |
1014 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1014 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1015 pathOffset += 8; | 1015 pathOffset += 8; |
1016 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1016 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1017 | 1017 |
(...skipping 14 matching lines...) Expand all Loading... |
1032 } | 1032 } |
1033 } | 1033 } |
1034 | 1034 |
1035 | 1035 |
1036 var h = { | 1036 var h = { |
1037 "content-type" : "application/json; charset=utf-8", | 1037 "content-type" : "application/json; charset=utf-8", |
1038 }; | 1038 }; |
1039 var resp = convert.JSON.encode(buildSubscription()); | 1039 var resp = convert.JSON.encode(buildSubscription()); |
1040 return new async.Future.value(stringResponse(200, h, resp)); | 1040 return new async.Future.value(stringResponse(200, h, resp)); |
1041 }), true); | 1041 }), true); |
1042 res.get(arg_subscription).then(unittest.expectAsync(((api.Subscription res
ponse) { | 1042 res.get(arg_subscription).then(unittest.expectAsync1(((api.Subscription re
sponse) { |
1043 checkSubscription(response); | 1043 checkSubscription(response); |
1044 }))); | 1044 }))); |
1045 }); | 1045 }); |
1046 | 1046 |
1047 unittest.test("method--getIamPolicy", () { | 1047 unittest.test("method--getIamPolicy", () { |
1048 | 1048 |
1049 var mock = new HttpServerMock(); | 1049 var mock = new HttpServerMock(); |
1050 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1050 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1051 var arg_resource = "foo"; | 1051 var arg_resource = "foo"; |
1052 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1052 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1053 var path = (req.url).path; | 1053 var path = (req.url).path; |
1054 var pathOffset = 0; | 1054 var pathOffset = 0; |
1055 var index; | 1055 var index; |
1056 var subPart; | 1056 var subPart; |
1057 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1057 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1058 pathOffset += 1; | 1058 pathOffset += 1; |
1059 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1059 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1060 pathOffset += 8; | 1060 pathOffset += 8; |
1061 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1061 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1062 | 1062 |
(...skipping 14 matching lines...) Expand all Loading... |
1077 } | 1077 } |
1078 } | 1078 } |
1079 | 1079 |
1080 | 1080 |
1081 var h = { | 1081 var h = { |
1082 "content-type" : "application/json; charset=utf-8", | 1082 "content-type" : "application/json; charset=utf-8", |
1083 }; | 1083 }; |
1084 var resp = convert.JSON.encode(buildPolicy()); | 1084 var resp = convert.JSON.encode(buildPolicy()); |
1085 return new async.Future.value(stringResponse(200, h, resp)); | 1085 return new async.Future.value(stringResponse(200, h, resp)); |
1086 }), true); | 1086 }), true); |
1087 res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy resp
onse) { | 1087 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res
ponse) { |
1088 checkPolicy(response); | 1088 checkPolicy(response); |
1089 }))); | 1089 }))); |
1090 }); | 1090 }); |
1091 | 1091 |
1092 unittest.test("method--list", () { | 1092 unittest.test("method--list", () { |
1093 | 1093 |
1094 var mock = new HttpServerMock(); | 1094 var mock = new HttpServerMock(); |
1095 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1095 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1096 var arg_project = "foo"; | 1096 var arg_project = "foo"; |
| 1097 var arg_pageToken = "foo"; |
1097 var arg_pageSize = 42; | 1098 var arg_pageSize = 42; |
1098 var arg_pageToken = "foo"; | 1099 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1099 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1100 var path = (req.url).path; | 1100 var path = (req.url).path; |
1101 var pathOffset = 0; | 1101 var pathOffset = 0; |
1102 var index; | 1102 var index; |
1103 var subPart; | 1103 var subPart; |
1104 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1104 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1105 pathOffset += 1; | 1105 pathOffset += 1; |
1106 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1106 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1107 pathOffset += 8; | 1107 pathOffset += 8; |
1108 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1108 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1109 | 1109 |
1110 var query = (req.url).query; | 1110 var query = (req.url).query; |
1111 var queryOffset = 0; | 1111 var queryOffset = 0; |
1112 var queryMap = {}; | 1112 var queryMap = {}; |
1113 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1113 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1114 parseBool(n) { | 1114 parseBool(n) { |
1115 if (n == "true") return true; | 1115 if (n == "true") return true; |
1116 if (n == "false") return false; | 1116 if (n == "false") return false; |
1117 if (n == null) return null; | 1117 if (n == null) return null; |
1118 throw new core.ArgumentError("Invalid boolean: $n"); | 1118 throw new core.ArgumentError("Invalid boolean: $n"); |
1119 } | 1119 } |
1120 if (query.length > 0) { | 1120 if (query.length > 0) { |
1121 for (var part in query.split("&")) { | 1121 for (var part in query.split("&")) { |
1122 var keyvalue = part.split("="); | 1122 var keyvalue = part.split("="); |
1123 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1123 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1124 } | 1124 } |
1125 } | 1125 } |
| 1126 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1126 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1127 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1127 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
1128 | 1128 |
1129 | 1129 |
1130 var h = { | 1130 var h = { |
1131 "content-type" : "application/json; charset=utf-8", | 1131 "content-type" : "application/json; charset=utf-8", |
1132 }; | 1132 }; |
1133 var resp = convert.JSON.encode(buildListSubscriptionsResponse()); | 1133 var resp = convert.JSON.encode(buildListSubscriptionsResponse()); |
1134 return new async.Future.value(stringResponse(200, h, resp)); | 1134 return new async.Future.value(stringResponse(200, h, resp)); |
1135 }), true); | 1135 }), true); |
1136 res.list(arg_project, pageSize: arg_pageSize, pageToken: arg_pageToken).th
en(unittest.expectAsync(((api.ListSubscriptionsResponse response) { | 1136 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th
en(unittest.expectAsync1(((api.ListSubscriptionsResponse response) { |
1137 checkListSubscriptionsResponse(response); | 1137 checkListSubscriptionsResponse(response); |
1138 }))); | 1138 }))); |
1139 }); | 1139 }); |
1140 | 1140 |
1141 unittest.test("method--modifyAckDeadline", () { | 1141 unittest.test("method--modifyAckDeadline", () { |
1142 | 1142 |
1143 var mock = new HttpServerMock(); | 1143 var mock = new HttpServerMock(); |
1144 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1144 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1145 var arg_request = buildModifyAckDeadlineRequest(); | 1145 var arg_request = buildModifyAckDeadlineRequest(); |
1146 var arg_subscription = "foo"; | 1146 var arg_subscription = "foo"; |
1147 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1147 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1148 var obj = new api.ModifyAckDeadlineRequest.fromJson(json); | 1148 var obj = new api.ModifyAckDeadlineRequest.fromJson(json); |
1149 checkModifyAckDeadlineRequest(obj); | 1149 checkModifyAckDeadlineRequest(obj); |
1150 | 1150 |
1151 var path = (req.url).path; | 1151 var path = (req.url).path; |
1152 var pathOffset = 0; | 1152 var pathOffset = 0; |
1153 var index; | 1153 var index; |
1154 var subPart; | 1154 var subPart; |
1155 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1155 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1156 pathOffset += 1; | 1156 pathOffset += 1; |
1157 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1157 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1175 } | 1175 } |
1176 } | 1176 } |
1177 | 1177 |
1178 | 1178 |
1179 var h = { | 1179 var h = { |
1180 "content-type" : "application/json; charset=utf-8", | 1180 "content-type" : "application/json; charset=utf-8", |
1181 }; | 1181 }; |
1182 var resp = convert.JSON.encode(buildEmpty()); | 1182 var resp = convert.JSON.encode(buildEmpty()); |
1183 return new async.Future.value(stringResponse(200, h, resp)); | 1183 return new async.Future.value(stringResponse(200, h, resp)); |
1184 }), true); | 1184 }), true); |
1185 res.modifyAckDeadline(arg_request, arg_subscription).then(unittest.expectA
sync(((api.Empty response) { | 1185 res.modifyAckDeadline(arg_request, arg_subscription).then(unittest.expectA
sync1(((api.Empty response) { |
1186 checkEmpty(response); | 1186 checkEmpty(response); |
1187 }))); | 1187 }))); |
1188 }); | 1188 }); |
1189 | 1189 |
1190 unittest.test("method--modifyPushConfig", () { | 1190 unittest.test("method--modifyPushConfig", () { |
1191 | 1191 |
1192 var mock = new HttpServerMock(); | 1192 var mock = new HttpServerMock(); |
1193 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1193 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1194 var arg_request = buildModifyPushConfigRequest(); | 1194 var arg_request = buildModifyPushConfigRequest(); |
1195 var arg_subscription = "foo"; | 1195 var arg_subscription = "foo"; |
1196 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1196 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1197 var obj = new api.ModifyPushConfigRequest.fromJson(json); | 1197 var obj = new api.ModifyPushConfigRequest.fromJson(json); |
1198 checkModifyPushConfigRequest(obj); | 1198 checkModifyPushConfigRequest(obj); |
1199 | 1199 |
1200 var path = (req.url).path; | 1200 var path = (req.url).path; |
1201 var pathOffset = 0; | 1201 var pathOffset = 0; |
1202 var index; | 1202 var index; |
1203 var subPart; | 1203 var subPart; |
1204 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1204 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1205 pathOffset += 1; | 1205 pathOffset += 1; |
1206 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1206 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1224 } | 1224 } |
1225 } | 1225 } |
1226 | 1226 |
1227 | 1227 |
1228 var h = { | 1228 var h = { |
1229 "content-type" : "application/json; charset=utf-8", | 1229 "content-type" : "application/json; charset=utf-8", |
1230 }; | 1230 }; |
1231 var resp = convert.JSON.encode(buildEmpty()); | 1231 var resp = convert.JSON.encode(buildEmpty()); |
1232 return new async.Future.value(stringResponse(200, h, resp)); | 1232 return new async.Future.value(stringResponse(200, h, resp)); |
1233 }), true); | 1233 }), true); |
1234 res.modifyPushConfig(arg_request, arg_subscription).then(unittest.expectAs
ync(((api.Empty response) { | 1234 res.modifyPushConfig(arg_request, arg_subscription).then(unittest.expectAs
ync1(((api.Empty response) { |
1235 checkEmpty(response); | 1235 checkEmpty(response); |
1236 }))); | 1236 }))); |
1237 }); | 1237 }); |
1238 | 1238 |
1239 unittest.test("method--pull", () { | 1239 unittest.test("method--pull", () { |
1240 | 1240 |
1241 var mock = new HttpServerMock(); | 1241 var mock = new HttpServerMock(); |
1242 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1242 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1243 var arg_request = buildPullRequest(); | 1243 var arg_request = buildPullRequest(); |
1244 var arg_subscription = "foo"; | 1244 var arg_subscription = "foo"; |
1245 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1245 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1246 var obj = new api.PullRequest.fromJson(json); | 1246 var obj = new api.PullRequest.fromJson(json); |
1247 checkPullRequest(obj); | 1247 checkPullRequest(obj); |
1248 | 1248 |
1249 var path = (req.url).path; | 1249 var path = (req.url).path; |
1250 var pathOffset = 0; | 1250 var pathOffset = 0; |
1251 var index; | 1251 var index; |
1252 var subPart; | 1252 var subPart; |
1253 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1253 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1254 pathOffset += 1; | 1254 pathOffset += 1; |
1255 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1255 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1273 } | 1273 } |
1274 } | 1274 } |
1275 | 1275 |
1276 | 1276 |
1277 var h = { | 1277 var h = { |
1278 "content-type" : "application/json; charset=utf-8", | 1278 "content-type" : "application/json; charset=utf-8", |
1279 }; | 1279 }; |
1280 var resp = convert.JSON.encode(buildPullResponse()); | 1280 var resp = convert.JSON.encode(buildPullResponse()); |
1281 return new async.Future.value(stringResponse(200, h, resp)); | 1281 return new async.Future.value(stringResponse(200, h, resp)); |
1282 }), true); | 1282 }), true); |
1283 res.pull(arg_request, arg_subscription).then(unittest.expectAsync(((api.Pu
llResponse response) { | 1283 res.pull(arg_request, arg_subscription).then(unittest.expectAsync1(((api.P
ullResponse response) { |
1284 checkPullResponse(response); | 1284 checkPullResponse(response); |
1285 }))); | 1285 }))); |
1286 }); | 1286 }); |
1287 | 1287 |
1288 unittest.test("method--setIamPolicy", () { | 1288 unittest.test("method--setIamPolicy", () { |
1289 | 1289 |
1290 var mock = new HttpServerMock(); | 1290 var mock = new HttpServerMock(); |
1291 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1291 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1292 var arg_request = buildSetIamPolicyRequest(); | 1292 var arg_request = buildSetIamPolicyRequest(); |
1293 var arg_resource = "foo"; | 1293 var arg_resource = "foo"; |
1294 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1294 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1295 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1295 var obj = new api.SetIamPolicyRequest.fromJson(json); |
1296 checkSetIamPolicyRequest(obj); | 1296 checkSetIamPolicyRequest(obj); |
1297 | 1297 |
1298 var path = (req.url).path; | 1298 var path = (req.url).path; |
1299 var pathOffset = 0; | 1299 var pathOffset = 0; |
1300 var index; | 1300 var index; |
1301 var subPart; | 1301 var subPart; |
1302 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1302 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1303 pathOffset += 1; | 1303 pathOffset += 1; |
1304 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1304 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1322 } | 1322 } |
1323 } | 1323 } |
1324 | 1324 |
1325 | 1325 |
1326 var h = { | 1326 var h = { |
1327 "content-type" : "application/json; charset=utf-8", | 1327 "content-type" : "application/json; charset=utf-8", |
1328 }; | 1328 }; |
1329 var resp = convert.JSON.encode(buildPolicy()); | 1329 var resp = convert.JSON.encode(buildPolicy()); |
1330 return new async.Future.value(stringResponse(200, h, resp)); | 1330 return new async.Future.value(stringResponse(200, h, resp)); |
1331 }), true); | 1331 }), true); |
1332 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1332 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
1333 checkPolicy(response); | 1333 checkPolicy(response); |
1334 }))); | 1334 }))); |
1335 }); | 1335 }); |
1336 | 1336 |
1337 unittest.test("method--testIamPermissions", () { | 1337 unittest.test("method--testIamPermissions", () { |
1338 | 1338 |
1339 var mock = new HttpServerMock(); | 1339 var mock = new HttpServerMock(); |
1340 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1340 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
1341 var arg_request = buildTestIamPermissionsRequest(); | 1341 var arg_request = buildTestIamPermissionsRequest(); |
1342 var arg_resource = "foo"; | 1342 var arg_resource = "foo"; |
1343 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1343 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1344 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1344 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
1345 checkTestIamPermissionsRequest(obj); | 1345 checkTestIamPermissionsRequest(obj); |
1346 | 1346 |
1347 var path = (req.url).path; | 1347 var path = (req.url).path; |
1348 var pathOffset = 0; | 1348 var pathOffset = 0; |
1349 var index; | 1349 var index; |
1350 var subPart; | 1350 var subPart; |
1351 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1351 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1352 pathOffset += 1; | 1352 pathOffset += 1; |
1353 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1353 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1371 } | 1371 } |
1372 } | 1372 } |
1373 | 1373 |
1374 | 1374 |
1375 var h = { | 1375 var h = { |
1376 "content-type" : "application/json; charset=utf-8", | 1376 "content-type" : "application/json; charset=utf-8", |
1377 }; | 1377 }; |
1378 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1378 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
1379 return new async.Future.value(stringResponse(200, h, resp)); | 1379 return new async.Future.value(stringResponse(200, h, resp)); |
1380 }), true); | 1380 }), true); |
1381 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 1381 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
1382 checkTestIamPermissionsResponse(response); | 1382 checkTestIamPermissionsResponse(response); |
1383 }))); | 1383 }))); |
1384 }); | 1384 }); |
1385 | 1385 |
1386 }); | 1386 }); |
1387 | 1387 |
1388 | 1388 |
1389 unittest.group("resource-ProjectsTopicsResourceApi", () { | 1389 unittest.group("resource-ProjectsTopicsResourceApi", () { |
1390 unittest.test("method--create", () { | 1390 unittest.test("method--create", () { |
1391 | 1391 |
1392 var mock = new HttpServerMock(); | 1392 var mock = new HttpServerMock(); |
1393 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1393 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1394 var arg_request = buildTopic(); | 1394 var arg_request = buildTopic(); |
1395 var arg_name = "foo"; | 1395 var arg_name = "foo"; |
1396 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1396 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1397 var obj = new api.Topic.fromJson(json); | 1397 var obj = new api.Topic.fromJson(json); |
1398 checkTopic(obj); | 1398 checkTopic(obj); |
1399 | 1399 |
1400 var path = (req.url).path; | 1400 var path = (req.url).path; |
1401 var pathOffset = 0; | 1401 var pathOffset = 0; |
1402 var index; | 1402 var index; |
1403 var subPart; | 1403 var subPart; |
1404 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1404 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1405 pathOffset += 1; | 1405 pathOffset += 1; |
1406 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1406 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1424 } | 1424 } |
1425 } | 1425 } |
1426 | 1426 |
1427 | 1427 |
1428 var h = { | 1428 var h = { |
1429 "content-type" : "application/json; charset=utf-8", | 1429 "content-type" : "application/json; charset=utf-8", |
1430 }; | 1430 }; |
1431 var resp = convert.JSON.encode(buildTopic()); | 1431 var resp = convert.JSON.encode(buildTopic()); |
1432 return new async.Future.value(stringResponse(200, h, resp)); | 1432 return new async.Future.value(stringResponse(200, h, resp)); |
1433 }), true); | 1433 }), true); |
1434 res.create(arg_request, arg_name).then(unittest.expectAsync(((api.Topic re
sponse) { | 1434 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Topic r
esponse) { |
1435 checkTopic(response); | 1435 checkTopic(response); |
1436 }))); | 1436 }))); |
1437 }); | 1437 }); |
1438 | 1438 |
1439 unittest.test("method--delete", () { | 1439 unittest.test("method--delete", () { |
1440 | 1440 |
1441 var mock = new HttpServerMock(); | 1441 var mock = new HttpServerMock(); |
1442 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1442 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1443 var arg_topic = "foo"; | 1443 var arg_topic = "foo"; |
1444 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1444 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1445 var path = (req.url).path; | 1445 var path = (req.url).path; |
1446 var pathOffset = 0; | 1446 var pathOffset = 0; |
1447 var index; | 1447 var index; |
1448 var subPart; | 1448 var subPart; |
1449 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1449 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1450 pathOffset += 1; | 1450 pathOffset += 1; |
1451 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1451 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1452 pathOffset += 8; | 1452 pathOffset += 8; |
1453 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1453 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1454 | 1454 |
(...skipping 14 matching lines...) Expand all Loading... |
1469 } | 1469 } |
1470 } | 1470 } |
1471 | 1471 |
1472 | 1472 |
1473 var h = { | 1473 var h = { |
1474 "content-type" : "application/json; charset=utf-8", | 1474 "content-type" : "application/json; charset=utf-8", |
1475 }; | 1475 }; |
1476 var resp = convert.JSON.encode(buildEmpty()); | 1476 var resp = convert.JSON.encode(buildEmpty()); |
1477 return new async.Future.value(stringResponse(200, h, resp)); | 1477 return new async.Future.value(stringResponse(200, h, resp)); |
1478 }), true); | 1478 }), true); |
1479 res.delete(arg_topic).then(unittest.expectAsync(((api.Empty response) { | 1479 res.delete(arg_topic).then(unittest.expectAsync1(((api.Empty response) { |
1480 checkEmpty(response); | 1480 checkEmpty(response); |
1481 }))); | 1481 }))); |
1482 }); | 1482 }); |
1483 | 1483 |
1484 unittest.test("method--get", () { | 1484 unittest.test("method--get", () { |
1485 | 1485 |
1486 var mock = new HttpServerMock(); | 1486 var mock = new HttpServerMock(); |
1487 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1487 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1488 var arg_topic = "foo"; | 1488 var arg_topic = "foo"; |
1489 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1489 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1490 var path = (req.url).path; | 1490 var path = (req.url).path; |
1491 var pathOffset = 0; | 1491 var pathOffset = 0; |
1492 var index; | 1492 var index; |
1493 var subPart; | 1493 var subPart; |
1494 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1494 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1495 pathOffset += 1; | 1495 pathOffset += 1; |
1496 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1496 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1497 pathOffset += 8; | 1497 pathOffset += 8; |
1498 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1498 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1499 | 1499 |
(...skipping 14 matching lines...) Expand all Loading... |
1514 } | 1514 } |
1515 } | 1515 } |
1516 | 1516 |
1517 | 1517 |
1518 var h = { | 1518 var h = { |
1519 "content-type" : "application/json; charset=utf-8", | 1519 "content-type" : "application/json; charset=utf-8", |
1520 }; | 1520 }; |
1521 var resp = convert.JSON.encode(buildTopic()); | 1521 var resp = convert.JSON.encode(buildTopic()); |
1522 return new async.Future.value(stringResponse(200, h, resp)); | 1522 return new async.Future.value(stringResponse(200, h, resp)); |
1523 }), true); | 1523 }), true); |
1524 res.get(arg_topic).then(unittest.expectAsync(((api.Topic response) { | 1524 res.get(arg_topic).then(unittest.expectAsync1(((api.Topic response) { |
1525 checkTopic(response); | 1525 checkTopic(response); |
1526 }))); | 1526 }))); |
1527 }); | 1527 }); |
1528 | 1528 |
1529 unittest.test("method--getIamPolicy", () { | 1529 unittest.test("method--getIamPolicy", () { |
1530 | 1530 |
1531 var mock = new HttpServerMock(); | 1531 var mock = new HttpServerMock(); |
1532 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1532 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1533 var arg_resource = "foo"; | 1533 var arg_resource = "foo"; |
1534 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1534 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1535 var path = (req.url).path; | 1535 var path = (req.url).path; |
1536 var pathOffset = 0; | 1536 var pathOffset = 0; |
1537 var index; | 1537 var index; |
1538 var subPart; | 1538 var subPart; |
1539 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1539 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1540 pathOffset += 1; | 1540 pathOffset += 1; |
1541 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1541 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1542 pathOffset += 8; | 1542 pathOffset += 8; |
1543 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1543 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1544 | 1544 |
(...skipping 14 matching lines...) Expand all Loading... |
1559 } | 1559 } |
1560 } | 1560 } |
1561 | 1561 |
1562 | 1562 |
1563 var h = { | 1563 var h = { |
1564 "content-type" : "application/json; charset=utf-8", | 1564 "content-type" : "application/json; charset=utf-8", |
1565 }; | 1565 }; |
1566 var resp = convert.JSON.encode(buildPolicy()); | 1566 var resp = convert.JSON.encode(buildPolicy()); |
1567 return new async.Future.value(stringResponse(200, h, resp)); | 1567 return new async.Future.value(stringResponse(200, h, resp)); |
1568 }), true); | 1568 }), true); |
1569 res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy resp
onse) { | 1569 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res
ponse) { |
1570 checkPolicy(response); | 1570 checkPolicy(response); |
1571 }))); | 1571 }))); |
1572 }); | 1572 }); |
1573 | 1573 |
1574 unittest.test("method--list", () { | 1574 unittest.test("method--list", () { |
1575 | 1575 |
1576 var mock = new HttpServerMock(); | 1576 var mock = new HttpServerMock(); |
1577 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1577 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1578 var arg_project = "foo"; | 1578 var arg_project = "foo"; |
| 1579 var arg_pageToken = "foo"; |
1579 var arg_pageSize = 42; | 1580 var arg_pageSize = 42; |
1580 var arg_pageToken = "foo"; | 1581 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1581 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1582 var path = (req.url).path; | 1582 var path = (req.url).path; |
1583 var pathOffset = 0; | 1583 var pathOffset = 0; |
1584 var index; | 1584 var index; |
1585 var subPart; | 1585 var subPart; |
1586 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1586 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1587 pathOffset += 1; | 1587 pathOffset += 1; |
1588 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1588 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1589 pathOffset += 8; | 1589 pathOffset += 8; |
1590 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1590 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1591 | 1591 |
1592 var query = (req.url).query; | 1592 var query = (req.url).query; |
1593 var queryOffset = 0; | 1593 var queryOffset = 0; |
1594 var queryMap = {}; | 1594 var queryMap = {}; |
1595 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1595 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1596 parseBool(n) { | 1596 parseBool(n) { |
1597 if (n == "true") return true; | 1597 if (n == "true") return true; |
1598 if (n == "false") return false; | 1598 if (n == "false") return false; |
1599 if (n == null) return null; | 1599 if (n == null) return null; |
1600 throw new core.ArgumentError("Invalid boolean: $n"); | 1600 throw new core.ArgumentError("Invalid boolean: $n"); |
1601 } | 1601 } |
1602 if (query.length > 0) { | 1602 if (query.length > 0) { |
1603 for (var part in query.split("&")) { | 1603 for (var part in query.split("&")) { |
1604 var keyvalue = part.split("="); | 1604 var keyvalue = part.split("="); |
1605 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1605 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1606 } | 1606 } |
1607 } | 1607 } |
| 1608 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1608 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1609 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1609 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
1610 | 1610 |
1611 | 1611 |
1612 var h = { | 1612 var h = { |
1613 "content-type" : "application/json; charset=utf-8", | 1613 "content-type" : "application/json; charset=utf-8", |
1614 }; | 1614 }; |
1615 var resp = convert.JSON.encode(buildListTopicsResponse()); | 1615 var resp = convert.JSON.encode(buildListTopicsResponse()); |
1616 return new async.Future.value(stringResponse(200, h, resp)); | 1616 return new async.Future.value(stringResponse(200, h, resp)); |
1617 }), true); | 1617 }), true); |
1618 res.list(arg_project, pageSize: arg_pageSize, pageToken: arg_pageToken).th
en(unittest.expectAsync(((api.ListTopicsResponse response) { | 1618 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th
en(unittest.expectAsync1(((api.ListTopicsResponse response) { |
1619 checkListTopicsResponse(response); | 1619 checkListTopicsResponse(response); |
1620 }))); | 1620 }))); |
1621 }); | 1621 }); |
1622 | 1622 |
1623 unittest.test("method--publish", () { | 1623 unittest.test("method--publish", () { |
1624 | 1624 |
1625 var mock = new HttpServerMock(); | 1625 var mock = new HttpServerMock(); |
1626 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1626 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1627 var arg_request = buildPublishRequest(); | 1627 var arg_request = buildPublishRequest(); |
1628 var arg_topic = "foo"; | 1628 var arg_topic = "foo"; |
1629 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1629 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1630 var obj = new api.PublishRequest.fromJson(json); | 1630 var obj = new api.PublishRequest.fromJson(json); |
1631 checkPublishRequest(obj); | 1631 checkPublishRequest(obj); |
1632 | 1632 |
1633 var path = (req.url).path; | 1633 var path = (req.url).path; |
1634 var pathOffset = 0; | 1634 var pathOffset = 0; |
1635 var index; | 1635 var index; |
1636 var subPart; | 1636 var subPart; |
1637 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1637 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1638 pathOffset += 1; | 1638 pathOffset += 1; |
1639 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1639 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1657 } | 1657 } |
1658 } | 1658 } |
1659 | 1659 |
1660 | 1660 |
1661 var h = { | 1661 var h = { |
1662 "content-type" : "application/json; charset=utf-8", | 1662 "content-type" : "application/json; charset=utf-8", |
1663 }; | 1663 }; |
1664 var resp = convert.JSON.encode(buildPublishResponse()); | 1664 var resp = convert.JSON.encode(buildPublishResponse()); |
1665 return new async.Future.value(stringResponse(200, h, resp)); | 1665 return new async.Future.value(stringResponse(200, h, resp)); |
1666 }), true); | 1666 }), true); |
1667 res.publish(arg_request, arg_topic).then(unittest.expectAsync(((api.Publis
hResponse response) { | 1667 res.publish(arg_request, arg_topic).then(unittest.expectAsync1(((api.Publi
shResponse response) { |
1668 checkPublishResponse(response); | 1668 checkPublishResponse(response); |
1669 }))); | 1669 }))); |
1670 }); | 1670 }); |
1671 | 1671 |
1672 unittest.test("method--setIamPolicy", () { | 1672 unittest.test("method--setIamPolicy", () { |
1673 | 1673 |
1674 var mock = new HttpServerMock(); | 1674 var mock = new HttpServerMock(); |
1675 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1675 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1676 var arg_request = buildSetIamPolicyRequest(); | 1676 var arg_request = buildSetIamPolicyRequest(); |
1677 var arg_resource = "foo"; | 1677 var arg_resource = "foo"; |
1678 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1678 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1679 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1679 var obj = new api.SetIamPolicyRequest.fromJson(json); |
1680 checkSetIamPolicyRequest(obj); | 1680 checkSetIamPolicyRequest(obj); |
1681 | 1681 |
1682 var path = (req.url).path; | 1682 var path = (req.url).path; |
1683 var pathOffset = 0; | 1683 var pathOffset = 0; |
1684 var index; | 1684 var index; |
1685 var subPart; | 1685 var subPart; |
1686 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1686 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1687 pathOffset += 1; | 1687 pathOffset += 1; |
1688 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1688 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1706 } | 1706 } |
1707 } | 1707 } |
1708 | 1708 |
1709 | 1709 |
1710 var h = { | 1710 var h = { |
1711 "content-type" : "application/json; charset=utf-8", | 1711 "content-type" : "application/json; charset=utf-8", |
1712 }; | 1712 }; |
1713 var resp = convert.JSON.encode(buildPolicy()); | 1713 var resp = convert.JSON.encode(buildPolicy()); |
1714 return new async.Future.value(stringResponse(200, h, resp)); | 1714 return new async.Future.value(stringResponse(200, h, resp)); |
1715 }), true); | 1715 }), true); |
1716 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1716 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
1717 checkPolicy(response); | 1717 checkPolicy(response); |
1718 }))); | 1718 }))); |
1719 }); | 1719 }); |
1720 | 1720 |
1721 unittest.test("method--testIamPermissions", () { | 1721 unittest.test("method--testIamPermissions", () { |
1722 | 1722 |
1723 var mock = new HttpServerMock(); | 1723 var mock = new HttpServerMock(); |
1724 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1724 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
1725 var arg_request = buildTestIamPermissionsRequest(); | 1725 var arg_request = buildTestIamPermissionsRequest(); |
1726 var arg_resource = "foo"; | 1726 var arg_resource = "foo"; |
1727 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1727 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1728 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1728 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
1729 checkTestIamPermissionsRequest(obj); | 1729 checkTestIamPermissionsRequest(obj); |
1730 | 1730 |
1731 var path = (req.url).path; | 1731 var path = (req.url).path; |
1732 var pathOffset = 0; | 1732 var pathOffset = 0; |
1733 var index; | 1733 var index; |
1734 var subPart; | 1734 var subPart; |
1735 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1735 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1736 pathOffset += 1; | 1736 pathOffset += 1; |
1737 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1737 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
(...skipping 17 matching lines...) Expand all Loading... |
1755 } | 1755 } |
1756 } | 1756 } |
1757 | 1757 |
1758 | 1758 |
1759 var h = { | 1759 var h = { |
1760 "content-type" : "application/json; charset=utf-8", | 1760 "content-type" : "application/json; charset=utf-8", |
1761 }; | 1761 }; |
1762 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1762 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
1763 return new async.Future.value(stringResponse(200, h, resp)); | 1763 return new async.Future.value(stringResponse(200, h, resp)); |
1764 }), true); | 1764 }), true); |
1765 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 1765 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
1766 checkTestIamPermissionsResponse(response); | 1766 checkTestIamPermissionsResponse(response); |
1767 }))); | 1767 }))); |
1768 }); | 1768 }); |
1769 | 1769 |
1770 }); | 1770 }); |
1771 | 1771 |
1772 | 1772 |
1773 unittest.group("resource-ProjectsTopicsSubscriptionsResourceApi", () { | 1773 unittest.group("resource-ProjectsTopicsSubscriptionsResourceApi", () { |
1774 unittest.test("method--list", () { | 1774 unittest.test("method--list", () { |
1775 | 1775 |
1776 var mock = new HttpServerMock(); | 1776 var mock = new HttpServerMock(); |
1777 api.ProjectsTopicsSubscriptionsResourceApi res = new api.PubsubApi(mock).p
rojects.topics.subscriptions; | 1777 api.ProjectsTopicsSubscriptionsResourceApi res = new api.PubsubApi(mock).p
rojects.topics.subscriptions; |
1778 var arg_topic = "foo"; | 1778 var arg_topic = "foo"; |
1779 var arg_pageToken = "foo"; | 1779 var arg_pageToken = "foo"; |
1780 var arg_pageSize = 42; | 1780 var arg_pageSize = 42; |
1781 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1781 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1782 var path = (req.url).path; | 1782 var path = (req.url).path; |
1783 var pathOffset = 0; | 1783 var pathOffset = 0; |
1784 var index; | 1784 var index; |
1785 var subPart; | 1785 var subPart; |
1786 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1786 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1787 pathOffset += 1; | 1787 pathOffset += 1; |
1788 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); | 1788 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta2/")); |
1789 pathOffset += 8; | 1789 pathOffset += 8; |
1790 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1790 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1791 | 1791 |
(...skipping 16 matching lines...) Expand all Loading... |
1808 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1808 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1809 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1809 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1810 | 1810 |
1811 | 1811 |
1812 var h = { | 1812 var h = { |
1813 "content-type" : "application/json; charset=utf-8", | 1813 "content-type" : "application/json; charset=utf-8", |
1814 }; | 1814 }; |
1815 var resp = convert.JSON.encode(buildListTopicSubscriptionsResponse()); | 1815 var resp = convert.JSON.encode(buildListTopicSubscriptionsResponse()); |
1816 return new async.Future.value(stringResponse(200, h, resp)); | 1816 return new async.Future.value(stringResponse(200, h, resp)); |
1817 }), true); | 1817 }), true); |
1818 res.list(arg_topic, pageToken: arg_pageToken, pageSize: arg_pageSize).then
(unittest.expectAsync(((api.ListTopicSubscriptionsResponse response) { | 1818 res.list(arg_topic, pageToken: arg_pageToken, pageSize: arg_pageSize).then
(unittest.expectAsync1(((api.ListTopicSubscriptionsResponse response) { |
1819 checkListTopicSubscriptionsResponse(response); | 1819 checkListTopicSubscriptionsResponse(response); |
1820 }))); | 1820 }))); |
1821 }); | 1821 }); |
1822 | 1822 |
1823 }); | 1823 }); |
1824 | 1824 |
1825 | 1825 |
1826 } | 1826 } |
1827 | 1827 |
OLD | NEW |