Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Side by Side Diff: generated/googleapis/test/pubsub/v1_test.dart

Issue 3006323002: Api-Roll 54: 2017-09-11 (Closed)
Patch Set: use 2.0.0-dev.infinity sdk constraint in pubspecs Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 library googleapis.pubsub.v1.test; 1 library googleapis.pubsub.v1.test;
2 2
3 import "dart:core" as core; 3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async; 4 import "dart:async" as async;
6 import "dart:convert" as convert; 5 import "dart:convert" as convert;
7 6
8 import 'package:http/http.dart' as http; 7 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing;
10 import 'package:test/test.dart' as unittest; 8 import 'package:test/test.dart' as unittest;
11 9
12 import 'package:googleapis/pubsub/v1.dart' as api; 10 import 'package:googleapis/pubsub/v1.dart' as api;
13 11
14 class HttpServerMock extends http.BaseClient { 12 class HttpServerMock extends http.BaseClient {
15 core.Function _callback; 13 core.Function _callback;
16 core.bool _expectJson; 14 core.bool _expectJson;
17 15
18 void register(core.Function callback, core.bool expectJson) { 16 void register(core.Function callback, core.bool expectJson) {
19 _callback = callback; 17 _callback = callback;
20 _expectJson = expectJson; 18 _expectJson = expectJson;
21 } 19 }
22 20
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) {
24 if (_expectJson) { 22 if (_expectJson) {
25 return request.finalize() 23 return request
24 .finalize()
26 .transform(convert.UTF8.decoder) 25 .transform(convert.UTF8.decoder)
27 .join('') 26 .join('')
28 .then((core.String jsonString) { 27 .then((core.String jsonString) {
29 if (jsonString.isEmpty) { 28 if (jsonString.isEmpty) {
30 return _callback(request, null); 29 return _callback(request, null);
31 } else { 30 } else {
32 return _callback(request, convert.JSON.decode(jsonString)); 31 return _callback(request, convert.JSON.decode(jsonString));
33 } 32 }
34 }); 33 });
35 } else { 34 } else {
36 var stream = request.finalize(); 35 var stream = request.finalize();
37 if (stream == null) { 36 if (stream == null) {
38 return _callback(request, []); 37 return _callback(request, []);
39 } else { 38 } else {
40 return stream.toBytes().then((data) { 39 return stream.toBytes().then((data) {
41 return _callback(request, data); 40 return _callback(request, data);
42 }); 41 });
43 } 42 }
44 } 43 }
45 } 44 }
46 } 45 }
47 46
48 http.StreamedResponse stringResponse( 47 http.StreamedResponse stringResponse(core.int status,
49 core.int status, core.Map<core.String, core.String> headers, core.String bod y) { 48 core.Map<core.String, core.String> headers, core.String body) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers); 50 return new http.StreamedResponse(stream, status, headers: headers);
52 } 51 }
53 52
54 buildUnnamed1273() { 53 buildUnnamed1269() {
55 var o = new core.List<core.String>(); 54 var o = new core.List<core.String>();
56 o.add("foo"); 55 o.add("foo");
57 o.add("foo"); 56 o.add("foo");
58 return o; 57 return o;
59 } 58 }
60 59
61 checkUnnamed1273(core.List<core.String> o) { 60 checkUnnamed1269(core.List<core.String> o) {
62 unittest.expect(o, unittest.hasLength(2)); 61 unittest.expect(o, unittest.hasLength(2));
63 unittest.expect(o[0], unittest.equals('foo')); 62 unittest.expect(o[0], unittest.equals('foo'));
64 unittest.expect(o[1], unittest.equals('foo')); 63 unittest.expect(o[1], unittest.equals('foo'));
65 } 64 }
66 65
67 core.int buildCounterAcknowledgeRequest = 0; 66 core.int buildCounterAcknowledgeRequest = 0;
68 buildAcknowledgeRequest() { 67 buildAcknowledgeRequest() {
69 var o = new api.AcknowledgeRequest(); 68 var o = new api.AcknowledgeRequest();
70 buildCounterAcknowledgeRequest++; 69 buildCounterAcknowledgeRequest++;
71 if (buildCounterAcknowledgeRequest < 3) { 70 if (buildCounterAcknowledgeRequest < 3) {
72 o.ackIds = buildUnnamed1273(); 71 o.ackIds = buildUnnamed1269();
73 } 72 }
74 buildCounterAcknowledgeRequest--; 73 buildCounterAcknowledgeRequest--;
75 return o; 74 return o;
76 } 75 }
77 76
78 checkAcknowledgeRequest(api.AcknowledgeRequest o) { 77 checkAcknowledgeRequest(api.AcknowledgeRequest o) {
79 buildCounterAcknowledgeRequest++; 78 buildCounterAcknowledgeRequest++;
80 if (buildCounterAcknowledgeRequest < 3) { 79 if (buildCounterAcknowledgeRequest < 3) {
81 checkUnnamed1273(o.ackIds); 80 checkUnnamed1269(o.ackIds);
82 } 81 }
83 buildCounterAcknowledgeRequest--; 82 buildCounterAcknowledgeRequest--;
84 } 83 }
85 84
86 buildUnnamed1274() { 85 buildUnnamed1270() {
87 var o = new core.List<core.String>(); 86 var o = new core.List<core.String>();
88 o.add("foo"); 87 o.add("foo");
89 o.add("foo"); 88 o.add("foo");
90 return o; 89 return o;
91 } 90 }
92 91
93 checkUnnamed1274(core.List<core.String> o) { 92 checkUnnamed1270(core.List<core.String> o) {
94 unittest.expect(o, unittest.hasLength(2)); 93 unittest.expect(o, unittest.hasLength(2));
95 unittest.expect(o[0], unittest.equals('foo')); 94 unittest.expect(o[0], unittest.equals('foo'));
96 unittest.expect(o[1], unittest.equals('foo')); 95 unittest.expect(o[1], unittest.equals('foo'));
97 } 96 }
98 97
99 core.int buildCounterBinding = 0; 98 core.int buildCounterBinding = 0;
100 buildBinding() { 99 buildBinding() {
101 var o = new api.Binding(); 100 var o = new api.Binding();
102 buildCounterBinding++; 101 buildCounterBinding++;
103 if (buildCounterBinding < 3) { 102 if (buildCounterBinding < 3) {
104 o.members = buildUnnamed1274(); 103 o.members = buildUnnamed1270();
105 o.role = "foo"; 104 o.role = "foo";
106 } 105 }
107 buildCounterBinding--; 106 buildCounterBinding--;
108 return o; 107 return o;
109 } 108 }
110 109
111 checkBinding(api.Binding o) { 110 checkBinding(api.Binding o) {
112 buildCounterBinding++; 111 buildCounterBinding++;
113 if (buildCounterBinding < 3) { 112 if (buildCounterBinding < 3) {
114 checkUnnamed1274(o.members); 113 checkUnnamed1270(o.members);
115 unittest.expect(o.role, unittest.equals('foo')); 114 unittest.expect(o.role, unittest.equals('foo'));
116 } 115 }
117 buildCounterBinding--; 116 buildCounterBinding--;
118 } 117 }
119 118
120 core.int buildCounterEmpty = 0; 119 core.int buildCounterEmpty = 0;
121 buildEmpty() { 120 buildEmpty() {
122 var o = new api.Empty(); 121 var o = new api.Empty();
123 buildCounterEmpty++; 122 buildCounterEmpty++;
124 if (buildCounterEmpty < 3) { 123 if (buildCounterEmpty < 3) {}
125 }
126 buildCounterEmpty--; 124 buildCounterEmpty--;
127 return o; 125 return o;
128 } 126 }
129 127
130 checkEmpty(api.Empty o) { 128 checkEmpty(api.Empty o) {
131 buildCounterEmpty++; 129 buildCounterEmpty++;
132 if (buildCounterEmpty < 3) { 130 if (buildCounterEmpty < 3) {}
133 }
134 buildCounterEmpty--; 131 buildCounterEmpty--;
135 } 132 }
136 133
137 buildUnnamed1275() { 134 buildUnnamed1271() {
138 var o = new core.List<api.Subscription>(); 135 var o = new core.List<api.Subscription>();
139 o.add(buildSubscription()); 136 o.add(buildSubscription());
140 o.add(buildSubscription()); 137 o.add(buildSubscription());
141 return o; 138 return o;
142 } 139 }
143 140
144 checkUnnamed1275(core.List<api.Subscription> o) { 141 checkUnnamed1271(core.List<api.Subscription> o) {
145 unittest.expect(o, unittest.hasLength(2)); 142 unittest.expect(o, unittest.hasLength(2));
146 checkSubscription(o[0]); 143 checkSubscription(o[0]);
147 checkSubscription(o[1]); 144 checkSubscription(o[1]);
148 } 145 }
149 146
150 core.int buildCounterListSubscriptionsResponse = 0; 147 core.int buildCounterListSubscriptionsResponse = 0;
151 buildListSubscriptionsResponse() { 148 buildListSubscriptionsResponse() {
152 var o = new api.ListSubscriptionsResponse(); 149 var o = new api.ListSubscriptionsResponse();
153 buildCounterListSubscriptionsResponse++; 150 buildCounterListSubscriptionsResponse++;
154 if (buildCounterListSubscriptionsResponse < 3) { 151 if (buildCounterListSubscriptionsResponse < 3) {
155 o.nextPageToken = "foo"; 152 o.nextPageToken = "foo";
156 o.subscriptions = buildUnnamed1275(); 153 o.subscriptions = buildUnnamed1271();
157 } 154 }
158 buildCounterListSubscriptionsResponse--; 155 buildCounterListSubscriptionsResponse--;
159 return o; 156 return o;
160 } 157 }
161 158
162 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { 159 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) {
163 buildCounterListSubscriptionsResponse++; 160 buildCounterListSubscriptionsResponse++;
164 if (buildCounterListSubscriptionsResponse < 3) { 161 if (buildCounterListSubscriptionsResponse < 3) {
165 unittest.expect(o.nextPageToken, unittest.equals('foo')); 162 unittest.expect(o.nextPageToken, unittest.equals('foo'));
166 checkUnnamed1275(o.subscriptions); 163 checkUnnamed1271(o.subscriptions);
167 } 164 }
168 buildCounterListSubscriptionsResponse--; 165 buildCounterListSubscriptionsResponse--;
169 } 166 }
170 167
171 buildUnnamed1276() { 168 buildUnnamed1272() {
172 var o = new core.List<core.String>(); 169 var o = new core.List<core.String>();
173 o.add("foo"); 170 o.add("foo");
174 o.add("foo"); 171 o.add("foo");
175 return o; 172 return o;
176 } 173 }
177 174
178 checkUnnamed1276(core.List<core.String> o) { 175 checkUnnamed1272(core.List<core.String> o) {
179 unittest.expect(o, unittest.hasLength(2)); 176 unittest.expect(o, unittest.hasLength(2));
180 unittest.expect(o[0], unittest.equals('foo')); 177 unittest.expect(o[0], unittest.equals('foo'));
181 unittest.expect(o[1], unittest.equals('foo')); 178 unittest.expect(o[1], unittest.equals('foo'));
182 } 179 }
183 180
184 core.int buildCounterListTopicSubscriptionsResponse = 0; 181 core.int buildCounterListTopicSubscriptionsResponse = 0;
185 buildListTopicSubscriptionsResponse() { 182 buildListTopicSubscriptionsResponse() {
186 var o = new api.ListTopicSubscriptionsResponse(); 183 var o = new api.ListTopicSubscriptionsResponse();
187 buildCounterListTopicSubscriptionsResponse++; 184 buildCounterListTopicSubscriptionsResponse++;
188 if (buildCounterListTopicSubscriptionsResponse < 3) { 185 if (buildCounterListTopicSubscriptionsResponse < 3) {
189 o.nextPageToken = "foo"; 186 o.nextPageToken = "foo";
190 o.subscriptions = buildUnnamed1276(); 187 o.subscriptions = buildUnnamed1272();
191 } 188 }
192 buildCounterListTopicSubscriptionsResponse--; 189 buildCounterListTopicSubscriptionsResponse--;
193 return o; 190 return o;
194 } 191 }
195 192
196 checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) { 193 checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) {
197 buildCounterListTopicSubscriptionsResponse++; 194 buildCounterListTopicSubscriptionsResponse++;
198 if (buildCounterListTopicSubscriptionsResponse < 3) { 195 if (buildCounterListTopicSubscriptionsResponse < 3) {
199 unittest.expect(o.nextPageToken, unittest.equals('foo')); 196 unittest.expect(o.nextPageToken, unittest.equals('foo'));
200 checkUnnamed1276(o.subscriptions); 197 checkUnnamed1272(o.subscriptions);
201 } 198 }
202 buildCounterListTopicSubscriptionsResponse--; 199 buildCounterListTopicSubscriptionsResponse--;
203 } 200 }
204 201
205 buildUnnamed1277() { 202 buildUnnamed1273() {
206 var o = new core.List<api.Topic>(); 203 var o = new core.List<api.Topic>();
207 o.add(buildTopic()); 204 o.add(buildTopic());
208 o.add(buildTopic()); 205 o.add(buildTopic());
209 return o; 206 return o;
210 } 207 }
211 208
212 checkUnnamed1277(core.List<api.Topic> o) { 209 checkUnnamed1273(core.List<api.Topic> o) {
213 unittest.expect(o, unittest.hasLength(2)); 210 unittest.expect(o, unittest.hasLength(2));
214 checkTopic(o[0]); 211 checkTopic(o[0]);
215 checkTopic(o[1]); 212 checkTopic(o[1]);
216 } 213 }
217 214
218 core.int buildCounterListTopicsResponse = 0; 215 core.int buildCounterListTopicsResponse = 0;
219 buildListTopicsResponse() { 216 buildListTopicsResponse() {
220 var o = new api.ListTopicsResponse(); 217 var o = new api.ListTopicsResponse();
221 buildCounterListTopicsResponse++; 218 buildCounterListTopicsResponse++;
222 if (buildCounterListTopicsResponse < 3) { 219 if (buildCounterListTopicsResponse < 3) {
223 o.nextPageToken = "foo"; 220 o.nextPageToken = "foo";
224 o.topics = buildUnnamed1277(); 221 o.topics = buildUnnamed1273();
225 } 222 }
226 buildCounterListTopicsResponse--; 223 buildCounterListTopicsResponse--;
227 return o; 224 return o;
228 } 225 }
229 226
230 checkListTopicsResponse(api.ListTopicsResponse o) { 227 checkListTopicsResponse(api.ListTopicsResponse o) {
231 buildCounterListTopicsResponse++; 228 buildCounterListTopicsResponse++;
232 if (buildCounterListTopicsResponse < 3) { 229 if (buildCounterListTopicsResponse < 3) {
233 unittest.expect(o.nextPageToken, unittest.equals('foo')); 230 unittest.expect(o.nextPageToken, unittest.equals('foo'));
234 checkUnnamed1277(o.topics); 231 checkUnnamed1273(o.topics);
235 } 232 }
236 buildCounterListTopicsResponse--; 233 buildCounterListTopicsResponse--;
237 } 234 }
238 235
239 buildUnnamed1278() { 236 buildUnnamed1274() {
240 var o = new core.List<core.String>(); 237 var o = new core.List<core.String>();
241 o.add("foo"); 238 o.add("foo");
242 o.add("foo"); 239 o.add("foo");
243 return o; 240 return o;
244 } 241 }
245 242
246 checkUnnamed1278(core.List<core.String> o) { 243 checkUnnamed1274(core.List<core.String> o) {
247 unittest.expect(o, unittest.hasLength(2)); 244 unittest.expect(o, unittest.hasLength(2));
248 unittest.expect(o[0], unittest.equals('foo')); 245 unittest.expect(o[0], unittest.equals('foo'));
249 unittest.expect(o[1], unittest.equals('foo')); 246 unittest.expect(o[1], unittest.equals('foo'));
250 } 247 }
251 248
252 core.int buildCounterModifyAckDeadlineRequest = 0; 249 core.int buildCounterModifyAckDeadlineRequest = 0;
253 buildModifyAckDeadlineRequest() { 250 buildModifyAckDeadlineRequest() {
254 var o = new api.ModifyAckDeadlineRequest(); 251 var o = new api.ModifyAckDeadlineRequest();
255 buildCounterModifyAckDeadlineRequest++; 252 buildCounterModifyAckDeadlineRequest++;
256 if (buildCounterModifyAckDeadlineRequest < 3) { 253 if (buildCounterModifyAckDeadlineRequest < 3) {
257 o.ackDeadlineSeconds = 42; 254 o.ackDeadlineSeconds = 42;
258 o.ackIds = buildUnnamed1278(); 255 o.ackIds = buildUnnamed1274();
259 } 256 }
260 buildCounterModifyAckDeadlineRequest--; 257 buildCounterModifyAckDeadlineRequest--;
261 return o; 258 return o;
262 } 259 }
263 260
264 checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) { 261 checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) {
265 buildCounterModifyAckDeadlineRequest++; 262 buildCounterModifyAckDeadlineRequest++;
266 if (buildCounterModifyAckDeadlineRequest < 3) { 263 if (buildCounterModifyAckDeadlineRequest < 3) {
267 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); 264 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42));
268 checkUnnamed1278(o.ackIds); 265 checkUnnamed1274(o.ackIds);
269 } 266 }
270 buildCounterModifyAckDeadlineRequest--; 267 buildCounterModifyAckDeadlineRequest--;
271 } 268 }
272 269
273 core.int buildCounterModifyPushConfigRequest = 0; 270 core.int buildCounterModifyPushConfigRequest = 0;
274 buildModifyPushConfigRequest() { 271 buildModifyPushConfigRequest() {
275 var o = new api.ModifyPushConfigRequest(); 272 var o = new api.ModifyPushConfigRequest();
276 buildCounterModifyPushConfigRequest++; 273 buildCounterModifyPushConfigRequest++;
277 if (buildCounterModifyPushConfigRequest < 3) { 274 if (buildCounterModifyPushConfigRequest < 3) {
278 o.pushConfig = buildPushConfig(); 275 o.pushConfig = buildPushConfig();
279 } 276 }
280 buildCounterModifyPushConfigRequest--; 277 buildCounterModifyPushConfigRequest--;
281 return o; 278 return o;
282 } 279 }
283 280
284 checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) { 281 checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) {
285 buildCounterModifyPushConfigRequest++; 282 buildCounterModifyPushConfigRequest++;
286 if (buildCounterModifyPushConfigRequest < 3) { 283 if (buildCounterModifyPushConfigRequest < 3) {
287 checkPushConfig(o.pushConfig); 284 checkPushConfig(o.pushConfig);
288 } 285 }
289 buildCounterModifyPushConfigRequest--; 286 buildCounterModifyPushConfigRequest--;
290 } 287 }
291 288
292 buildUnnamed1279() { 289 buildUnnamed1275() {
293 var o = new core.List<api.Binding>(); 290 var o = new core.List<api.Binding>();
294 o.add(buildBinding()); 291 o.add(buildBinding());
295 o.add(buildBinding()); 292 o.add(buildBinding());
296 return o; 293 return o;
297 } 294 }
298 295
299 checkUnnamed1279(core.List<api.Binding> o) { 296 checkUnnamed1275(core.List<api.Binding> o) {
300 unittest.expect(o, unittest.hasLength(2)); 297 unittest.expect(o, unittest.hasLength(2));
301 checkBinding(o[0]); 298 checkBinding(o[0]);
302 checkBinding(o[1]); 299 checkBinding(o[1]);
303 } 300 }
304 301
305 core.int buildCounterPolicy = 0; 302 core.int buildCounterPolicy = 0;
306 buildPolicy() { 303 buildPolicy() {
307 var o = new api.Policy(); 304 var o = new api.Policy();
308 buildCounterPolicy++; 305 buildCounterPolicy++;
309 if (buildCounterPolicy < 3) { 306 if (buildCounterPolicy < 3) {
310 o.bindings = buildUnnamed1279(); 307 o.bindings = buildUnnamed1275();
311 o.etag = "foo"; 308 o.etag = "foo";
312 o.version = 42; 309 o.version = 42;
313 } 310 }
314 buildCounterPolicy--; 311 buildCounterPolicy--;
315 return o; 312 return o;
316 } 313 }
317 314
318 checkPolicy(api.Policy o) { 315 checkPolicy(api.Policy o) {
319 buildCounterPolicy++; 316 buildCounterPolicy++;
320 if (buildCounterPolicy < 3) { 317 if (buildCounterPolicy < 3) {
321 checkUnnamed1279(o.bindings); 318 checkUnnamed1275(o.bindings);
322 unittest.expect(o.etag, unittest.equals('foo')); 319 unittest.expect(o.etag, unittest.equals('foo'));
323 unittest.expect(o.version, unittest.equals(42)); 320 unittest.expect(o.version, unittest.equals(42));
324 } 321 }
325 buildCounterPolicy--; 322 buildCounterPolicy--;
326 } 323 }
327 324
328 buildUnnamed1280() { 325 buildUnnamed1276() {
329 var o = new core.List<api.PubsubMessage>(); 326 var o = new core.List<api.PubsubMessage>();
330 o.add(buildPubsubMessage()); 327 o.add(buildPubsubMessage());
331 o.add(buildPubsubMessage()); 328 o.add(buildPubsubMessage());
332 return o; 329 return o;
333 } 330 }
334 331
335 checkUnnamed1280(core.List<api.PubsubMessage> o) { 332 checkUnnamed1276(core.List<api.PubsubMessage> o) {
336 unittest.expect(o, unittest.hasLength(2)); 333 unittest.expect(o, unittest.hasLength(2));
337 checkPubsubMessage(o[0]); 334 checkPubsubMessage(o[0]);
338 checkPubsubMessage(o[1]); 335 checkPubsubMessage(o[1]);
339 } 336 }
340 337
341 core.int buildCounterPublishRequest = 0; 338 core.int buildCounterPublishRequest = 0;
342 buildPublishRequest() { 339 buildPublishRequest() {
343 var o = new api.PublishRequest(); 340 var o = new api.PublishRequest();
344 buildCounterPublishRequest++; 341 buildCounterPublishRequest++;
345 if (buildCounterPublishRequest < 3) { 342 if (buildCounterPublishRequest < 3) {
346 o.messages = buildUnnamed1280(); 343 o.messages = buildUnnamed1276();
347 } 344 }
348 buildCounterPublishRequest--; 345 buildCounterPublishRequest--;
349 return o; 346 return o;
350 } 347 }
351 348
352 checkPublishRequest(api.PublishRequest o) { 349 checkPublishRequest(api.PublishRequest o) {
353 buildCounterPublishRequest++; 350 buildCounterPublishRequest++;
354 if (buildCounterPublishRequest < 3) { 351 if (buildCounterPublishRequest < 3) {
355 checkUnnamed1280(o.messages); 352 checkUnnamed1276(o.messages);
356 } 353 }
357 buildCounterPublishRequest--; 354 buildCounterPublishRequest--;
358 } 355 }
359 356
360 buildUnnamed1281() { 357 buildUnnamed1277() {
361 var o = new core.List<core.String>(); 358 var o = new core.List<core.String>();
362 o.add("foo"); 359 o.add("foo");
363 o.add("foo"); 360 o.add("foo");
364 return o; 361 return o;
365 } 362 }
366 363
367 checkUnnamed1281(core.List<core.String> o) { 364 checkUnnamed1277(core.List<core.String> o) {
368 unittest.expect(o, unittest.hasLength(2)); 365 unittest.expect(o, unittest.hasLength(2));
369 unittest.expect(o[0], unittest.equals('foo')); 366 unittest.expect(o[0], unittest.equals('foo'));
370 unittest.expect(o[1], unittest.equals('foo')); 367 unittest.expect(o[1], unittest.equals('foo'));
371 } 368 }
372 369
373 core.int buildCounterPublishResponse = 0; 370 core.int buildCounterPublishResponse = 0;
374 buildPublishResponse() { 371 buildPublishResponse() {
375 var o = new api.PublishResponse(); 372 var o = new api.PublishResponse();
376 buildCounterPublishResponse++; 373 buildCounterPublishResponse++;
377 if (buildCounterPublishResponse < 3) { 374 if (buildCounterPublishResponse < 3) {
378 o.messageIds = buildUnnamed1281(); 375 o.messageIds = buildUnnamed1277();
379 } 376 }
380 buildCounterPublishResponse--; 377 buildCounterPublishResponse--;
381 return o; 378 return o;
382 } 379 }
383 380
384 checkPublishResponse(api.PublishResponse o) { 381 checkPublishResponse(api.PublishResponse o) {
385 buildCounterPublishResponse++; 382 buildCounterPublishResponse++;
386 if (buildCounterPublishResponse < 3) { 383 if (buildCounterPublishResponse < 3) {
387 checkUnnamed1281(o.messageIds); 384 checkUnnamed1277(o.messageIds);
388 } 385 }
389 buildCounterPublishResponse--; 386 buildCounterPublishResponse--;
390 } 387 }
391 388
392 buildUnnamed1282() { 389 buildUnnamed1278() {
393 var o = new core.Map<core.String, core.String>(); 390 var o = new core.Map<core.String, core.String>();
394 o["x"] = "foo"; 391 o["x"] = "foo";
395 o["y"] = "foo"; 392 o["y"] = "foo";
396 return o; 393 return o;
397 } 394 }
398 395
399 checkUnnamed1282(core.Map<core.String, core.String> o) { 396 checkUnnamed1278(core.Map<core.String, core.String> o) {
400 unittest.expect(o, unittest.hasLength(2)); 397 unittest.expect(o, unittest.hasLength(2));
401 unittest.expect(o["x"], unittest.equals('foo')); 398 unittest.expect(o["x"], unittest.equals('foo'));
402 unittest.expect(o["y"], unittest.equals('foo')); 399 unittest.expect(o["y"], unittest.equals('foo'));
403 } 400 }
404 401
405 core.int buildCounterPubsubMessage = 0; 402 core.int buildCounterPubsubMessage = 0;
406 buildPubsubMessage() { 403 buildPubsubMessage() {
407 var o = new api.PubsubMessage(); 404 var o = new api.PubsubMessage();
408 buildCounterPubsubMessage++; 405 buildCounterPubsubMessage++;
409 if (buildCounterPubsubMessage < 3) { 406 if (buildCounterPubsubMessage < 3) {
410 o.attributes = buildUnnamed1282(); 407 o.attributes = buildUnnamed1278();
411 o.data = "foo"; 408 o.data = "foo";
412 o.messageId = "foo"; 409 o.messageId = "foo";
413 o.publishTime = "foo"; 410 o.publishTime = "foo";
414 } 411 }
415 buildCounterPubsubMessage--; 412 buildCounterPubsubMessage--;
416 return o; 413 return o;
417 } 414 }
418 415
419 checkPubsubMessage(api.PubsubMessage o) { 416 checkPubsubMessage(api.PubsubMessage o) {
420 buildCounterPubsubMessage++; 417 buildCounterPubsubMessage++;
421 if (buildCounterPubsubMessage < 3) { 418 if (buildCounterPubsubMessage < 3) {
422 checkUnnamed1282(o.attributes); 419 checkUnnamed1278(o.attributes);
423 unittest.expect(o.data, unittest.equals('foo')); 420 unittest.expect(o.data, unittest.equals('foo'));
424 unittest.expect(o.messageId, unittest.equals('foo')); 421 unittest.expect(o.messageId, unittest.equals('foo'));
425 unittest.expect(o.publishTime, unittest.equals('foo')); 422 unittest.expect(o.publishTime, unittest.equals('foo'));
426 } 423 }
427 buildCounterPubsubMessage--; 424 buildCounterPubsubMessage--;
428 } 425 }
429 426
430 core.int buildCounterPullRequest = 0; 427 core.int buildCounterPullRequest = 0;
431 buildPullRequest() { 428 buildPullRequest() {
432 var o = new api.PullRequest(); 429 var o = new api.PullRequest();
433 buildCounterPullRequest++; 430 buildCounterPullRequest++;
434 if (buildCounterPullRequest < 3) { 431 if (buildCounterPullRequest < 3) {
435 o.maxMessages = 42; 432 o.maxMessages = 42;
436 o.returnImmediately = true; 433 o.returnImmediately = true;
437 } 434 }
438 buildCounterPullRequest--; 435 buildCounterPullRequest--;
439 return o; 436 return o;
440 } 437 }
441 438
442 checkPullRequest(api.PullRequest o) { 439 checkPullRequest(api.PullRequest o) {
443 buildCounterPullRequest++; 440 buildCounterPullRequest++;
444 if (buildCounterPullRequest < 3) { 441 if (buildCounterPullRequest < 3) {
445 unittest.expect(o.maxMessages, unittest.equals(42)); 442 unittest.expect(o.maxMessages, unittest.equals(42));
446 unittest.expect(o.returnImmediately, unittest.isTrue); 443 unittest.expect(o.returnImmediately, unittest.isTrue);
447 } 444 }
448 buildCounterPullRequest--; 445 buildCounterPullRequest--;
449 } 446 }
450 447
451 buildUnnamed1283() { 448 buildUnnamed1279() {
452 var o = new core.List<api.ReceivedMessage>(); 449 var o = new core.List<api.ReceivedMessage>();
453 o.add(buildReceivedMessage()); 450 o.add(buildReceivedMessage());
454 o.add(buildReceivedMessage()); 451 o.add(buildReceivedMessage());
455 return o; 452 return o;
456 } 453 }
457 454
458 checkUnnamed1283(core.List<api.ReceivedMessage> o) { 455 checkUnnamed1279(core.List<api.ReceivedMessage> o) {
459 unittest.expect(o, unittest.hasLength(2)); 456 unittest.expect(o, unittest.hasLength(2));
460 checkReceivedMessage(o[0]); 457 checkReceivedMessage(o[0]);
461 checkReceivedMessage(o[1]); 458 checkReceivedMessage(o[1]);
462 } 459 }
463 460
464 core.int buildCounterPullResponse = 0; 461 core.int buildCounterPullResponse = 0;
465 buildPullResponse() { 462 buildPullResponse() {
466 var o = new api.PullResponse(); 463 var o = new api.PullResponse();
467 buildCounterPullResponse++; 464 buildCounterPullResponse++;
468 if (buildCounterPullResponse < 3) { 465 if (buildCounterPullResponse < 3) {
469 o.receivedMessages = buildUnnamed1283(); 466 o.receivedMessages = buildUnnamed1279();
470 } 467 }
471 buildCounterPullResponse--; 468 buildCounterPullResponse--;
472 return o; 469 return o;
473 } 470 }
474 471
475 checkPullResponse(api.PullResponse o) { 472 checkPullResponse(api.PullResponse o) {
476 buildCounterPullResponse++; 473 buildCounterPullResponse++;
477 if (buildCounterPullResponse < 3) { 474 if (buildCounterPullResponse < 3) {
478 checkUnnamed1283(o.receivedMessages); 475 checkUnnamed1279(o.receivedMessages);
479 } 476 }
480 buildCounterPullResponse--; 477 buildCounterPullResponse--;
481 } 478 }
482 479
483 buildUnnamed1284() { 480 buildUnnamed1280() {
484 var o = new core.Map<core.String, core.String>(); 481 var o = new core.Map<core.String, core.String>();
485 o["x"] = "foo"; 482 o["x"] = "foo";
486 o["y"] = "foo"; 483 o["y"] = "foo";
487 return o; 484 return o;
488 } 485 }
489 486
490 checkUnnamed1284(core.Map<core.String, core.String> o) { 487 checkUnnamed1280(core.Map<core.String, core.String> o) {
491 unittest.expect(o, unittest.hasLength(2)); 488 unittest.expect(o, unittest.hasLength(2));
492 unittest.expect(o["x"], unittest.equals('foo')); 489 unittest.expect(o["x"], unittest.equals('foo'));
493 unittest.expect(o["y"], unittest.equals('foo')); 490 unittest.expect(o["y"], unittest.equals('foo'));
494 } 491 }
495 492
496 core.int buildCounterPushConfig = 0; 493 core.int buildCounterPushConfig = 0;
497 buildPushConfig() { 494 buildPushConfig() {
498 var o = new api.PushConfig(); 495 var o = new api.PushConfig();
499 buildCounterPushConfig++; 496 buildCounterPushConfig++;
500 if (buildCounterPushConfig < 3) { 497 if (buildCounterPushConfig < 3) {
501 o.attributes = buildUnnamed1284(); 498 o.attributes = buildUnnamed1280();
502 o.pushEndpoint = "foo"; 499 o.pushEndpoint = "foo";
503 } 500 }
504 buildCounterPushConfig--; 501 buildCounterPushConfig--;
505 return o; 502 return o;
506 } 503 }
507 504
508 checkPushConfig(api.PushConfig o) { 505 checkPushConfig(api.PushConfig o) {
509 buildCounterPushConfig++; 506 buildCounterPushConfig++;
510 if (buildCounterPushConfig < 3) { 507 if (buildCounterPushConfig < 3) {
511 checkUnnamed1284(o.attributes); 508 checkUnnamed1280(o.attributes);
512 unittest.expect(o.pushEndpoint, unittest.equals('foo')); 509 unittest.expect(o.pushEndpoint, unittest.equals('foo'));
513 } 510 }
514 buildCounterPushConfig--; 511 buildCounterPushConfig--;
515 } 512 }
516 513
517 core.int buildCounterReceivedMessage = 0; 514 core.int buildCounterReceivedMessage = 0;
518 buildReceivedMessage() { 515 buildReceivedMessage() {
519 var o = new api.ReceivedMessage(); 516 var o = new api.ReceivedMessage();
520 buildCounterReceivedMessage++; 517 buildCounterReceivedMessage++;
521 if (buildCounterReceivedMessage < 3) { 518 if (buildCounterReceivedMessage < 3) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 buildCounterSubscription++; 569 buildCounterSubscription++;
573 if (buildCounterSubscription < 3) { 570 if (buildCounterSubscription < 3) {
574 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); 571 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42));
575 unittest.expect(o.name, unittest.equals('foo')); 572 unittest.expect(o.name, unittest.equals('foo'));
576 checkPushConfig(o.pushConfig); 573 checkPushConfig(o.pushConfig);
577 unittest.expect(o.topic, unittest.equals('foo')); 574 unittest.expect(o.topic, unittest.equals('foo'));
578 } 575 }
579 buildCounterSubscription--; 576 buildCounterSubscription--;
580 } 577 }
581 578
582 buildUnnamed1285() { 579 buildUnnamed1281() {
583 var o = new core.List<core.String>(); 580 var o = new core.List<core.String>();
584 o.add("foo"); 581 o.add("foo");
585 o.add("foo"); 582 o.add("foo");
586 return o; 583 return o;
587 } 584 }
588 585
589 checkUnnamed1285(core.List<core.String> o) { 586 checkUnnamed1281(core.List<core.String> o) {
590 unittest.expect(o, unittest.hasLength(2)); 587 unittest.expect(o, unittest.hasLength(2));
591 unittest.expect(o[0], unittest.equals('foo')); 588 unittest.expect(o[0], unittest.equals('foo'));
592 unittest.expect(o[1], unittest.equals('foo')); 589 unittest.expect(o[1], unittest.equals('foo'));
593 } 590 }
594 591
595 core.int buildCounterTestIamPermissionsRequest = 0; 592 core.int buildCounterTestIamPermissionsRequest = 0;
596 buildTestIamPermissionsRequest() { 593 buildTestIamPermissionsRequest() {
597 var o = new api.TestIamPermissionsRequest(); 594 var o = new api.TestIamPermissionsRequest();
598 buildCounterTestIamPermissionsRequest++; 595 buildCounterTestIamPermissionsRequest++;
599 if (buildCounterTestIamPermissionsRequest < 3) { 596 if (buildCounterTestIamPermissionsRequest < 3) {
600 o.permissions = buildUnnamed1285(); 597 o.permissions = buildUnnamed1281();
601 } 598 }
602 buildCounterTestIamPermissionsRequest--; 599 buildCounterTestIamPermissionsRequest--;
603 return o; 600 return o;
604 } 601 }
605 602
606 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { 603 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) {
607 buildCounterTestIamPermissionsRequest++; 604 buildCounterTestIamPermissionsRequest++;
608 if (buildCounterTestIamPermissionsRequest < 3) { 605 if (buildCounterTestIamPermissionsRequest < 3) {
609 checkUnnamed1285(o.permissions); 606 checkUnnamed1281(o.permissions);
610 } 607 }
611 buildCounterTestIamPermissionsRequest--; 608 buildCounterTestIamPermissionsRequest--;
612 } 609 }
613 610
614 buildUnnamed1286() { 611 buildUnnamed1282() {
615 var o = new core.List<core.String>(); 612 var o = new core.List<core.String>();
616 o.add("foo"); 613 o.add("foo");
617 o.add("foo"); 614 o.add("foo");
618 return o; 615 return o;
619 } 616 }
620 617
621 checkUnnamed1286(core.List<core.String> o) { 618 checkUnnamed1282(core.List<core.String> o) {
622 unittest.expect(o, unittest.hasLength(2)); 619 unittest.expect(o, unittest.hasLength(2));
623 unittest.expect(o[0], unittest.equals('foo')); 620 unittest.expect(o[0], unittest.equals('foo'));
624 unittest.expect(o[1], unittest.equals('foo')); 621 unittest.expect(o[1], unittest.equals('foo'));
625 } 622 }
626 623
627 core.int buildCounterTestIamPermissionsResponse = 0; 624 core.int buildCounterTestIamPermissionsResponse = 0;
628 buildTestIamPermissionsResponse() { 625 buildTestIamPermissionsResponse() {
629 var o = new api.TestIamPermissionsResponse(); 626 var o = new api.TestIamPermissionsResponse();
630 buildCounterTestIamPermissionsResponse++; 627 buildCounterTestIamPermissionsResponse++;
631 if (buildCounterTestIamPermissionsResponse < 3) { 628 if (buildCounterTestIamPermissionsResponse < 3) {
632 o.permissions = buildUnnamed1286(); 629 o.permissions = buildUnnamed1282();
633 } 630 }
634 buildCounterTestIamPermissionsResponse--; 631 buildCounterTestIamPermissionsResponse--;
635 return o; 632 return o;
636 } 633 }
637 634
638 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { 635 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) {
639 buildCounterTestIamPermissionsResponse++; 636 buildCounterTestIamPermissionsResponse++;
640 if (buildCounterTestIamPermissionsResponse < 3) { 637 if (buildCounterTestIamPermissionsResponse < 3) {
641 checkUnnamed1286(o.permissions); 638 checkUnnamed1282(o.permissions);
642 } 639 }
643 buildCounterTestIamPermissionsResponse--; 640 buildCounterTestIamPermissionsResponse--;
644 } 641 }
645 642
646 core.int buildCounterTopic = 0; 643 core.int buildCounterTopic = 0;
647 buildTopic() { 644 buildTopic() {
648 var o = new api.Topic(); 645 var o = new api.Topic();
649 buildCounterTopic++; 646 buildCounterTopic++;
650 if (buildCounterTopic < 3) { 647 if (buildCounterTopic < 3) {
651 o.name = "foo"; 648 o.name = "foo";
652 } 649 }
653 buildCounterTopic--; 650 buildCounterTopic--;
654 return o; 651 return o;
655 } 652 }
656 653
657 checkTopic(api.Topic o) { 654 checkTopic(api.Topic o) {
658 buildCounterTopic++; 655 buildCounterTopic++;
659 if (buildCounterTopic < 3) { 656 if (buildCounterTopic < 3) {
660 unittest.expect(o.name, unittest.equals('foo')); 657 unittest.expect(o.name, unittest.equals('foo'));
661 } 658 }
662 buildCounterTopic--; 659 buildCounterTopic--;
663 } 660 }
664 661
665
666 main() { 662 main() {
667 unittest.group("obj-schema-AcknowledgeRequest", () { 663 unittest.group("obj-schema-AcknowledgeRequest", () {
668 unittest.test("to-json--from-json", () { 664 unittest.test("to-json--from-json", () {
669 var o = buildAcknowledgeRequest(); 665 var o = buildAcknowledgeRequest();
670 var od = new api.AcknowledgeRequest.fromJson(o.toJson()); 666 var od = new api.AcknowledgeRequest.fromJson(o.toJson());
671 checkAcknowledgeRequest(od); 667 checkAcknowledgeRequest(od);
672 }); 668 });
673 }); 669 });
674 670
675
676 unittest.group("obj-schema-Binding", () { 671 unittest.group("obj-schema-Binding", () {
677 unittest.test("to-json--from-json", () { 672 unittest.test("to-json--from-json", () {
678 var o = buildBinding(); 673 var o = buildBinding();
679 var od = new api.Binding.fromJson(o.toJson()); 674 var od = new api.Binding.fromJson(o.toJson());
680 checkBinding(od); 675 checkBinding(od);
681 }); 676 });
682 }); 677 });
683 678
684
685 unittest.group("obj-schema-Empty", () { 679 unittest.group("obj-schema-Empty", () {
686 unittest.test("to-json--from-json", () { 680 unittest.test("to-json--from-json", () {
687 var o = buildEmpty(); 681 var o = buildEmpty();
688 var od = new api.Empty.fromJson(o.toJson()); 682 var od = new api.Empty.fromJson(o.toJson());
689 checkEmpty(od); 683 checkEmpty(od);
690 }); 684 });
691 }); 685 });
692 686
693
694 unittest.group("obj-schema-ListSubscriptionsResponse", () { 687 unittest.group("obj-schema-ListSubscriptionsResponse", () {
695 unittest.test("to-json--from-json", () { 688 unittest.test("to-json--from-json", () {
696 var o = buildListSubscriptionsResponse(); 689 var o = buildListSubscriptionsResponse();
697 var od = new api.ListSubscriptionsResponse.fromJson(o.toJson()); 690 var od = new api.ListSubscriptionsResponse.fromJson(o.toJson());
698 checkListSubscriptionsResponse(od); 691 checkListSubscriptionsResponse(od);
699 }); 692 });
700 }); 693 });
701 694
702
703 unittest.group("obj-schema-ListTopicSubscriptionsResponse", () { 695 unittest.group("obj-schema-ListTopicSubscriptionsResponse", () {
704 unittest.test("to-json--from-json", () { 696 unittest.test("to-json--from-json", () {
705 var o = buildListTopicSubscriptionsResponse(); 697 var o = buildListTopicSubscriptionsResponse();
706 var od = new api.ListTopicSubscriptionsResponse.fromJson(o.toJson()); 698 var od = new api.ListTopicSubscriptionsResponse.fromJson(o.toJson());
707 checkListTopicSubscriptionsResponse(od); 699 checkListTopicSubscriptionsResponse(od);
708 }); 700 });
709 }); 701 });
710 702
711
712 unittest.group("obj-schema-ListTopicsResponse", () { 703 unittest.group("obj-schema-ListTopicsResponse", () {
713 unittest.test("to-json--from-json", () { 704 unittest.test("to-json--from-json", () {
714 var o = buildListTopicsResponse(); 705 var o = buildListTopicsResponse();
715 var od = new api.ListTopicsResponse.fromJson(o.toJson()); 706 var od = new api.ListTopicsResponse.fromJson(o.toJson());
716 checkListTopicsResponse(od); 707 checkListTopicsResponse(od);
717 }); 708 });
718 }); 709 });
719 710
720
721 unittest.group("obj-schema-ModifyAckDeadlineRequest", () { 711 unittest.group("obj-schema-ModifyAckDeadlineRequest", () {
722 unittest.test("to-json--from-json", () { 712 unittest.test("to-json--from-json", () {
723 var o = buildModifyAckDeadlineRequest(); 713 var o = buildModifyAckDeadlineRequest();
724 var od = new api.ModifyAckDeadlineRequest.fromJson(o.toJson()); 714 var od = new api.ModifyAckDeadlineRequest.fromJson(o.toJson());
725 checkModifyAckDeadlineRequest(od); 715 checkModifyAckDeadlineRequest(od);
726 }); 716 });
727 }); 717 });
728 718
729
730 unittest.group("obj-schema-ModifyPushConfigRequest", () { 719 unittest.group("obj-schema-ModifyPushConfigRequest", () {
731 unittest.test("to-json--from-json", () { 720 unittest.test("to-json--from-json", () {
732 var o = buildModifyPushConfigRequest(); 721 var o = buildModifyPushConfigRequest();
733 var od = new api.ModifyPushConfigRequest.fromJson(o.toJson()); 722 var od = new api.ModifyPushConfigRequest.fromJson(o.toJson());
734 checkModifyPushConfigRequest(od); 723 checkModifyPushConfigRequest(od);
735 }); 724 });
736 }); 725 });
737 726
738
739 unittest.group("obj-schema-Policy", () { 727 unittest.group("obj-schema-Policy", () {
740 unittest.test("to-json--from-json", () { 728 unittest.test("to-json--from-json", () {
741 var o = buildPolicy(); 729 var o = buildPolicy();
742 var od = new api.Policy.fromJson(o.toJson()); 730 var od = new api.Policy.fromJson(o.toJson());
743 checkPolicy(od); 731 checkPolicy(od);
744 }); 732 });
745 }); 733 });
746 734
747
748 unittest.group("obj-schema-PublishRequest", () { 735 unittest.group("obj-schema-PublishRequest", () {
749 unittest.test("to-json--from-json", () { 736 unittest.test("to-json--from-json", () {
750 var o = buildPublishRequest(); 737 var o = buildPublishRequest();
751 var od = new api.PublishRequest.fromJson(o.toJson()); 738 var od = new api.PublishRequest.fromJson(o.toJson());
752 checkPublishRequest(od); 739 checkPublishRequest(od);
753 }); 740 });
754 }); 741 });
755 742
756
757 unittest.group("obj-schema-PublishResponse", () { 743 unittest.group("obj-schema-PublishResponse", () {
758 unittest.test("to-json--from-json", () { 744 unittest.test("to-json--from-json", () {
759 var o = buildPublishResponse(); 745 var o = buildPublishResponse();
760 var od = new api.PublishResponse.fromJson(o.toJson()); 746 var od = new api.PublishResponse.fromJson(o.toJson());
761 checkPublishResponse(od); 747 checkPublishResponse(od);
762 }); 748 });
763 }); 749 });
764 750
765
766 unittest.group("obj-schema-PubsubMessage", () { 751 unittest.group("obj-schema-PubsubMessage", () {
767 unittest.test("to-json--from-json", () { 752 unittest.test("to-json--from-json", () {
768 var o = buildPubsubMessage(); 753 var o = buildPubsubMessage();
769 var od = new api.PubsubMessage.fromJson(o.toJson()); 754 var od = new api.PubsubMessage.fromJson(o.toJson());
770 checkPubsubMessage(od); 755 checkPubsubMessage(od);
771 }); 756 });
772 }); 757 });
773 758
774
775 unittest.group("obj-schema-PullRequest", () { 759 unittest.group("obj-schema-PullRequest", () {
776 unittest.test("to-json--from-json", () { 760 unittest.test("to-json--from-json", () {
777 var o = buildPullRequest(); 761 var o = buildPullRequest();
778 var od = new api.PullRequest.fromJson(o.toJson()); 762 var od = new api.PullRequest.fromJson(o.toJson());
779 checkPullRequest(od); 763 checkPullRequest(od);
780 }); 764 });
781 }); 765 });
782 766
783
784 unittest.group("obj-schema-PullResponse", () { 767 unittest.group("obj-schema-PullResponse", () {
785 unittest.test("to-json--from-json", () { 768 unittest.test("to-json--from-json", () {
786 var o = buildPullResponse(); 769 var o = buildPullResponse();
787 var od = new api.PullResponse.fromJson(o.toJson()); 770 var od = new api.PullResponse.fromJson(o.toJson());
788 checkPullResponse(od); 771 checkPullResponse(od);
789 }); 772 });
790 }); 773 });
791 774
792
793 unittest.group("obj-schema-PushConfig", () { 775 unittest.group("obj-schema-PushConfig", () {
794 unittest.test("to-json--from-json", () { 776 unittest.test("to-json--from-json", () {
795 var o = buildPushConfig(); 777 var o = buildPushConfig();
796 var od = new api.PushConfig.fromJson(o.toJson()); 778 var od = new api.PushConfig.fromJson(o.toJson());
797 checkPushConfig(od); 779 checkPushConfig(od);
798 }); 780 });
799 }); 781 });
800 782
801
802 unittest.group("obj-schema-ReceivedMessage", () { 783 unittest.group("obj-schema-ReceivedMessage", () {
803 unittest.test("to-json--from-json", () { 784 unittest.test("to-json--from-json", () {
804 var o = buildReceivedMessage(); 785 var o = buildReceivedMessage();
805 var od = new api.ReceivedMessage.fromJson(o.toJson()); 786 var od = new api.ReceivedMessage.fromJson(o.toJson());
806 checkReceivedMessage(od); 787 checkReceivedMessage(od);
807 }); 788 });
808 }); 789 });
809 790
810
811 unittest.group("obj-schema-SetIamPolicyRequest", () { 791 unittest.group("obj-schema-SetIamPolicyRequest", () {
812 unittest.test("to-json--from-json", () { 792 unittest.test("to-json--from-json", () {
813 var o = buildSetIamPolicyRequest(); 793 var o = buildSetIamPolicyRequest();
814 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); 794 var od = new api.SetIamPolicyRequest.fromJson(o.toJson());
815 checkSetIamPolicyRequest(od); 795 checkSetIamPolicyRequest(od);
816 }); 796 });
817 }); 797 });
818 798
819
820 unittest.group("obj-schema-Subscription", () { 799 unittest.group("obj-schema-Subscription", () {
821 unittest.test("to-json--from-json", () { 800 unittest.test("to-json--from-json", () {
822 var o = buildSubscription(); 801 var o = buildSubscription();
823 var od = new api.Subscription.fromJson(o.toJson()); 802 var od = new api.Subscription.fromJson(o.toJson());
824 checkSubscription(od); 803 checkSubscription(od);
825 }); 804 });
826 }); 805 });
827 806
828
829 unittest.group("obj-schema-TestIamPermissionsRequest", () { 807 unittest.group("obj-schema-TestIamPermissionsRequest", () {
830 unittest.test("to-json--from-json", () { 808 unittest.test("to-json--from-json", () {
831 var o = buildTestIamPermissionsRequest(); 809 var o = buildTestIamPermissionsRequest();
832 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); 810 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson());
833 checkTestIamPermissionsRequest(od); 811 checkTestIamPermissionsRequest(od);
834 }); 812 });
835 }); 813 });
836 814
837
838 unittest.group("obj-schema-TestIamPermissionsResponse", () { 815 unittest.group("obj-schema-TestIamPermissionsResponse", () {
839 unittest.test("to-json--from-json", () { 816 unittest.test("to-json--from-json", () {
840 var o = buildTestIamPermissionsResponse(); 817 var o = buildTestIamPermissionsResponse();
841 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); 818 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson());
842 checkTestIamPermissionsResponse(od); 819 checkTestIamPermissionsResponse(od);
843 }); 820 });
844 }); 821 });
845 822
846
847 unittest.group("obj-schema-Topic", () { 823 unittest.group("obj-schema-Topic", () {
848 unittest.test("to-json--from-json", () { 824 unittest.test("to-json--from-json", () {
849 var o = buildTopic(); 825 var o = buildTopic();
850 var od = new api.Topic.fromJson(o.toJson()); 826 var od = new api.Topic.fromJson(o.toJson());
851 checkTopic(od); 827 checkTopic(od);
852 }); 828 });
853 }); 829 });
854 830
855
856 unittest.group("resource-ProjectsSnapshotsResourceApi", () { 831 unittest.group("resource-ProjectsSnapshotsResourceApi", () {
857 unittest.test("method--getIamPolicy", () { 832 unittest.test("method--getIamPolicy", () {
858
859 var mock = new HttpServerMock(); 833 var mock = new HttpServerMock();
860 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn apshots; 834 api.ProjectsSnapshotsResourceApi res =
835 new api.PubsubApi(mock).projects.snapshots;
861 var arg_resource = "foo"; 836 var arg_resource = "foo";
862 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 837 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
863 var path = (req.url).path; 838 var path = (req.url).path;
864 var pathOffset = 0; 839 var pathOffset = 0;
865 var index; 840 var index;
866 var subPart; 841 var subPart;
867 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 842 unittest.expect(
843 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
868 pathOffset += 1; 844 pathOffset += 1;
869 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 845 unittest.expect(
846 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
870 pathOffset += 3; 847 pathOffset += 3;
871 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 848 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
872 849
873 var query = (req.url).query; 850 var query = (req.url).query;
874 var queryOffset = 0; 851 var queryOffset = 0;
875 var queryMap = {}; 852 var queryMap = {};
876 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 853 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
877 parseBool(n) { 854 parseBool(n) {
878 if (n == "true") return true; 855 if (n == "true") return true;
879 if (n == "false") return false; 856 if (n == "false") return false;
880 if (n == null) return null; 857 if (n == null) return null;
881 throw new core.ArgumentError("Invalid boolean: $n"); 858 throw new core.ArgumentError("Invalid boolean: $n");
882 } 859 }
860
883 if (query.length > 0) { 861 if (query.length > 0) {
884 for (var part in query.split("&")) { 862 for (var part in query.split("&")) {
885 var keyvalue = part.split("="); 863 var keyvalue = part.split("=");
886 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 864 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
865 core.Uri.decodeQueryComponent(keyvalue[1]));
887 } 866 }
888 } 867 }
889 868
890
891 var h = { 869 var h = {
892 "content-type" : "application/json; charset=utf-8", 870 "content-type": "application/json; charset=utf-8",
893 }; 871 };
894 var resp = convert.JSON.encode(buildPolicy()); 872 var resp = convert.JSON.encode(buildPolicy());
895 return new async.Future.value(stringResponse(200, h, resp)); 873 return new async.Future.value(stringResponse(200, h, resp));
896 }), true); 874 }), true);
897 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res ponse) { 875 res
876 .getIamPolicy(arg_resource)
877 .then(unittest.expectAsync1(((api.Policy response) {
898 checkPolicy(response); 878 checkPolicy(response);
899 }))); 879 })));
900 }); 880 });
901 881
902 unittest.test("method--setIamPolicy", () { 882 unittest.test("method--setIamPolicy", () {
903
904 var mock = new HttpServerMock(); 883 var mock = new HttpServerMock();
905 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn apshots; 884 api.ProjectsSnapshotsResourceApi res =
885 new api.PubsubApi(mock).projects.snapshots;
906 var arg_request = buildSetIamPolicyRequest(); 886 var arg_request = buildSetIamPolicyRequest();
907 var arg_resource = "foo"; 887 var arg_resource = "foo";
908 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 888 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
909 var obj = new api.SetIamPolicyRequest.fromJson(json); 889 var obj = new api.SetIamPolicyRequest.fromJson(json);
910 checkSetIamPolicyRequest(obj); 890 checkSetIamPolicyRequest(obj);
911 891
912 var path = (req.url).path; 892 var path = (req.url).path;
913 var pathOffset = 0; 893 var pathOffset = 0;
914 var index; 894 var index;
915 var subPart; 895 var subPart;
916 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 896 unittest.expect(
897 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
917 pathOffset += 1; 898 pathOffset += 1;
918 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 899 unittest.expect(
900 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
919 pathOffset += 3; 901 pathOffset += 3;
920 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 902 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
921 903
922 var query = (req.url).query; 904 var query = (req.url).query;
923 var queryOffset = 0; 905 var queryOffset = 0;
924 var queryMap = {}; 906 var queryMap = {};
925 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 907 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
926 parseBool(n) { 908 parseBool(n) {
927 if (n == "true") return true; 909 if (n == "true") return true;
928 if (n == "false") return false; 910 if (n == "false") return false;
929 if (n == null) return null; 911 if (n == null) return null;
930 throw new core.ArgumentError("Invalid boolean: $n"); 912 throw new core.ArgumentError("Invalid boolean: $n");
931 } 913 }
914
932 if (query.length > 0) { 915 if (query.length > 0) {
933 for (var part in query.split("&")) { 916 for (var part in query.split("&")) {
934 var keyvalue = part.split("="); 917 var keyvalue = part.split("=");
935 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 918 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
919 core.Uri.decodeQueryComponent(keyvalue[1]));
936 } 920 }
937 } 921 }
938 922
939
940 var h = { 923 var h = {
941 "content-type" : "application/json; charset=utf-8", 924 "content-type": "application/json; charset=utf-8",
942 }; 925 };
943 var resp = convert.JSON.encode(buildPolicy()); 926 var resp = convert.JSON.encode(buildPolicy());
944 return new async.Future.value(stringResponse(200, h, resp)); 927 return new async.Future.value(stringResponse(200, h, resp));
945 }), true); 928 }), true);
946 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 929 res
930 .setIamPolicy(arg_request, arg_resource)
931 .then(unittest.expectAsync1(((api.Policy response) {
947 checkPolicy(response); 932 checkPolicy(response);
948 }))); 933 })));
949 }); 934 });
950 935
951 unittest.test("method--testIamPermissions", () { 936 unittest.test("method--testIamPermissions", () {
952
953 var mock = new HttpServerMock(); 937 var mock = new HttpServerMock();
954 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn apshots; 938 api.ProjectsSnapshotsResourceApi res =
939 new api.PubsubApi(mock).projects.snapshots;
955 var arg_request = buildTestIamPermissionsRequest(); 940 var arg_request = buildTestIamPermissionsRequest();
956 var arg_resource = "foo"; 941 var arg_resource = "foo";
957 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 942 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
958 var obj = new api.TestIamPermissionsRequest.fromJson(json); 943 var obj = new api.TestIamPermissionsRequest.fromJson(json);
959 checkTestIamPermissionsRequest(obj); 944 checkTestIamPermissionsRequest(obj);
960 945
961 var path = (req.url).path; 946 var path = (req.url).path;
962 var pathOffset = 0; 947 var pathOffset = 0;
963 var index; 948 var index;
964 var subPart; 949 var subPart;
965 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 950 unittest.expect(
951 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
966 pathOffset += 1; 952 pathOffset += 1;
967 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 953 unittest.expect(
954 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
968 pathOffset += 3; 955 pathOffset += 3;
969 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 956 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
970 957
971 var query = (req.url).query; 958 var query = (req.url).query;
972 var queryOffset = 0; 959 var queryOffset = 0;
973 var queryMap = {}; 960 var queryMap = {};
974 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 961 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
975 parseBool(n) { 962 parseBool(n) {
976 if (n == "true") return true; 963 if (n == "true") return true;
977 if (n == "false") return false; 964 if (n == "false") return false;
978 if (n == null) return null; 965 if (n == null) return null;
979 throw new core.ArgumentError("Invalid boolean: $n"); 966 throw new core.ArgumentError("Invalid boolean: $n");
980 } 967 }
968
981 if (query.length > 0) { 969 if (query.length > 0) {
982 for (var part in query.split("&")) { 970 for (var part in query.split("&")) {
983 var keyvalue = part.split("="); 971 var keyvalue = part.split("=");
984 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 972 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
973 core.Uri.decodeQueryComponent(keyvalue[1]));
985 } 974 }
986 } 975 }
987 976
988
989 var h = { 977 var h = {
990 "content-type" : "application/json; charset=utf-8", 978 "content-type": "application/json; charset=utf-8",
991 }; 979 };
992 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 980 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
993 return new async.Future.value(stringResponse(200, h, resp)); 981 return new async.Future.value(stringResponse(200, h, resp));
994 }), true); 982 }), true);
995 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 983 res.testIamPermissions(arg_request, arg_resource).then(
984 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
996 checkTestIamPermissionsResponse(response); 985 checkTestIamPermissionsResponse(response);
997 }))); 986 })));
998 }); 987 });
999
1000 }); 988 });
1001 989
1002
1003 unittest.group("resource-ProjectsSubscriptionsResourceApi", () { 990 unittest.group("resource-ProjectsSubscriptionsResourceApi", () {
1004 unittest.test("method--acknowledge", () { 991 unittest.test("method--acknowledge", () {
1005
1006 var mock = new HttpServerMock(); 992 var mock = new HttpServerMock();
1007 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 993 api.ProjectsSubscriptionsResourceApi res =
994 new api.PubsubApi(mock).projects.subscriptions;
1008 var arg_request = buildAcknowledgeRequest(); 995 var arg_request = buildAcknowledgeRequest();
1009 var arg_subscription = "foo"; 996 var arg_subscription = "foo";
1010 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 997 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1011 var obj = new api.AcknowledgeRequest.fromJson(json); 998 var obj = new api.AcknowledgeRequest.fromJson(json);
1012 checkAcknowledgeRequest(obj); 999 checkAcknowledgeRequest(obj);
1013 1000
1014 var path = (req.url).path; 1001 var path = (req.url).path;
1015 var pathOffset = 0; 1002 var pathOffset = 0;
1016 var index; 1003 var index;
1017 var subPart; 1004 var subPart;
1018 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1005 unittest.expect(
1006 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1019 pathOffset += 1; 1007 pathOffset += 1;
1020 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1008 unittest.expect(
1009 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1021 pathOffset += 3; 1010 pathOffset += 3;
1022 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1011 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1023 1012
1024 var query = (req.url).query; 1013 var query = (req.url).query;
1025 var queryOffset = 0; 1014 var queryOffset = 0;
1026 var queryMap = {}; 1015 var queryMap = {};
1027 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1016 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1028 parseBool(n) { 1017 parseBool(n) {
1029 if (n == "true") return true; 1018 if (n == "true") return true;
1030 if (n == "false") return false; 1019 if (n == "false") return false;
1031 if (n == null) return null; 1020 if (n == null) return null;
1032 throw new core.ArgumentError("Invalid boolean: $n"); 1021 throw new core.ArgumentError("Invalid boolean: $n");
1033 } 1022 }
1023
1034 if (query.length > 0) { 1024 if (query.length > 0) {
1035 for (var part in query.split("&")) { 1025 for (var part in query.split("&")) {
1036 var keyvalue = part.split("="); 1026 var keyvalue = part.split("=");
1037 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1027 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1028 core.Uri.decodeQueryComponent(keyvalue[1]));
1038 } 1029 }
1039 } 1030 }
1040 1031
1041
1042 var h = { 1032 var h = {
1043 "content-type" : "application/json; charset=utf-8", 1033 "content-type": "application/json; charset=utf-8",
1044 }; 1034 };
1045 var resp = convert.JSON.encode(buildEmpty()); 1035 var resp = convert.JSON.encode(buildEmpty());
1046 return new async.Future.value(stringResponse(200, h, resp)); 1036 return new async.Future.value(stringResponse(200, h, resp));
1047 }), true); 1037 }), true);
1048 res.acknowledge(arg_request, arg_subscription).then(unittest.expectAsync1( ((api.Empty response) { 1038 res
1039 .acknowledge(arg_request, arg_subscription)
1040 .then(unittest.expectAsync1(((api.Empty response) {
1049 checkEmpty(response); 1041 checkEmpty(response);
1050 }))); 1042 })));
1051 }); 1043 });
1052 1044
1053 unittest.test("method--create", () { 1045 unittest.test("method--create", () {
1054
1055 var mock = new HttpServerMock(); 1046 var mock = new HttpServerMock();
1056 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1047 api.ProjectsSubscriptionsResourceApi res =
1048 new api.PubsubApi(mock).projects.subscriptions;
1057 var arg_request = buildSubscription(); 1049 var arg_request = buildSubscription();
1058 var arg_name = "foo"; 1050 var arg_name = "foo";
1059 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1051 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1060 var obj = new api.Subscription.fromJson(json); 1052 var obj = new api.Subscription.fromJson(json);
1061 checkSubscription(obj); 1053 checkSubscription(obj);
1062 1054
1063 var path = (req.url).path; 1055 var path = (req.url).path;
1064 var pathOffset = 0; 1056 var pathOffset = 0;
1065 var index; 1057 var index;
1066 var subPart; 1058 var subPart;
1067 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1059 unittest.expect(
1060 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1068 pathOffset += 1; 1061 pathOffset += 1;
1069 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1062 unittest.expect(
1063 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1070 pathOffset += 3; 1064 pathOffset += 3;
1071 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1065 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1072 1066
1073 var query = (req.url).query; 1067 var query = (req.url).query;
1074 var queryOffset = 0; 1068 var queryOffset = 0;
1075 var queryMap = {}; 1069 var queryMap = {};
1076 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1070 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1077 parseBool(n) { 1071 parseBool(n) {
1078 if (n == "true") return true; 1072 if (n == "true") return true;
1079 if (n == "false") return false; 1073 if (n == "false") return false;
1080 if (n == null) return null; 1074 if (n == null) return null;
1081 throw new core.ArgumentError("Invalid boolean: $n"); 1075 throw new core.ArgumentError("Invalid boolean: $n");
1082 } 1076 }
1077
1083 if (query.length > 0) { 1078 if (query.length > 0) {
1084 for (var part in query.split("&")) { 1079 for (var part in query.split("&")) {
1085 var keyvalue = part.split("="); 1080 var keyvalue = part.split("=");
1086 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1081 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1082 core.Uri.decodeQueryComponent(keyvalue[1]));
1087 } 1083 }
1088 } 1084 }
1089 1085
1090
1091 var h = { 1086 var h = {
1092 "content-type" : "application/json; charset=utf-8", 1087 "content-type": "application/json; charset=utf-8",
1093 }; 1088 };
1094 var resp = convert.JSON.encode(buildSubscription()); 1089 var resp = convert.JSON.encode(buildSubscription());
1095 return new async.Future.value(stringResponse(200, h, resp)); 1090 return new async.Future.value(stringResponse(200, h, resp));
1096 }), true); 1091 }), true);
1097 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Subscri ption response) { 1092 res
1093 .create(arg_request, arg_name)
1094 .then(unittest.expectAsync1(((api.Subscription response) {
1098 checkSubscription(response); 1095 checkSubscription(response);
1099 }))); 1096 })));
1100 }); 1097 });
1101 1098
1102 unittest.test("method--delete", () { 1099 unittest.test("method--delete", () {
1103
1104 var mock = new HttpServerMock(); 1100 var mock = new HttpServerMock();
1105 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1101 api.ProjectsSubscriptionsResourceApi res =
1102 new api.PubsubApi(mock).projects.subscriptions;
1106 var arg_subscription = "foo"; 1103 var arg_subscription = "foo";
1107 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1104 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1108 var path = (req.url).path; 1105 var path = (req.url).path;
1109 var pathOffset = 0; 1106 var pathOffset = 0;
1110 var index; 1107 var index;
1111 var subPart; 1108 var subPart;
1112 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1109 unittest.expect(
1110 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1113 pathOffset += 1; 1111 pathOffset += 1;
1114 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1112 unittest.expect(
1113 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1115 pathOffset += 3; 1114 pathOffset += 3;
1116 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1115 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1117 1116
1118 var query = (req.url).query; 1117 var query = (req.url).query;
1119 var queryOffset = 0; 1118 var queryOffset = 0;
1120 var queryMap = {}; 1119 var queryMap = {};
1121 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1120 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1122 parseBool(n) { 1121 parseBool(n) {
1123 if (n == "true") return true; 1122 if (n == "true") return true;
1124 if (n == "false") return false; 1123 if (n == "false") return false;
1125 if (n == null) return null; 1124 if (n == null) return null;
1126 throw new core.ArgumentError("Invalid boolean: $n"); 1125 throw new core.ArgumentError("Invalid boolean: $n");
1127 } 1126 }
1127
1128 if (query.length > 0) { 1128 if (query.length > 0) {
1129 for (var part in query.split("&")) { 1129 for (var part in query.split("&")) {
1130 var keyvalue = part.split("="); 1130 var keyvalue = part.split("=");
1131 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1131 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1132 core.Uri.decodeQueryComponent(keyvalue[1]));
1132 } 1133 }
1133 } 1134 }
1134 1135
1135
1136 var h = { 1136 var h = {
1137 "content-type" : "application/json; charset=utf-8", 1137 "content-type": "application/json; charset=utf-8",
1138 }; 1138 };
1139 var resp = convert.JSON.encode(buildEmpty()); 1139 var resp = convert.JSON.encode(buildEmpty());
1140 return new async.Future.value(stringResponse(200, h, resp)); 1140 return new async.Future.value(stringResponse(200, h, resp));
1141 }), true); 1141 }), true);
1142 res.delete(arg_subscription).then(unittest.expectAsync1(((api.Empty respon se) { 1142 res
1143 .delete(arg_subscription)
1144 .then(unittest.expectAsync1(((api.Empty response) {
1143 checkEmpty(response); 1145 checkEmpty(response);
1144 }))); 1146 })));
1145 }); 1147 });
1146 1148
1147 unittest.test("method--get", () { 1149 unittest.test("method--get", () {
1148
1149 var mock = new HttpServerMock(); 1150 var mock = new HttpServerMock();
1150 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1151 api.ProjectsSubscriptionsResourceApi res =
1152 new api.PubsubApi(mock).projects.subscriptions;
1151 var arg_subscription = "foo"; 1153 var arg_subscription = "foo";
1152 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1154 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1153 var path = (req.url).path; 1155 var path = (req.url).path;
1154 var pathOffset = 0; 1156 var pathOffset = 0;
1155 var index; 1157 var index;
1156 var subPart; 1158 var subPart;
1157 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1159 unittest.expect(
1160 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1158 pathOffset += 1; 1161 pathOffset += 1;
1159 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1162 unittest.expect(
1163 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1160 pathOffset += 3; 1164 pathOffset += 3;
1161 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1165 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1162 1166
1163 var query = (req.url).query; 1167 var query = (req.url).query;
1164 var queryOffset = 0; 1168 var queryOffset = 0;
1165 var queryMap = {}; 1169 var queryMap = {};
1166 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1170 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1167 parseBool(n) { 1171 parseBool(n) {
1168 if (n == "true") return true; 1172 if (n == "true") return true;
1169 if (n == "false") return false; 1173 if (n == "false") return false;
1170 if (n == null) return null; 1174 if (n == null) return null;
1171 throw new core.ArgumentError("Invalid boolean: $n"); 1175 throw new core.ArgumentError("Invalid boolean: $n");
1172 } 1176 }
1177
1173 if (query.length > 0) { 1178 if (query.length > 0) {
1174 for (var part in query.split("&")) { 1179 for (var part in query.split("&")) {
1175 var keyvalue = part.split("="); 1180 var keyvalue = part.split("=");
1176 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1181 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1182 core.Uri.decodeQueryComponent(keyvalue[1]));
1177 } 1183 }
1178 } 1184 }
1179 1185
1180
1181 var h = { 1186 var h = {
1182 "content-type" : "application/json; charset=utf-8", 1187 "content-type": "application/json; charset=utf-8",
1183 }; 1188 };
1184 var resp = convert.JSON.encode(buildSubscription()); 1189 var resp = convert.JSON.encode(buildSubscription());
1185 return new async.Future.value(stringResponse(200, h, resp)); 1190 return new async.Future.value(stringResponse(200, h, resp));
1186 }), true); 1191 }), true);
1187 res.get(arg_subscription).then(unittest.expectAsync1(((api.Subscription re sponse) { 1192 res
1193 .get(arg_subscription)
1194 .then(unittest.expectAsync1(((api.Subscription response) {
1188 checkSubscription(response); 1195 checkSubscription(response);
1189 }))); 1196 })));
1190 }); 1197 });
1191 1198
1192 unittest.test("method--getIamPolicy", () { 1199 unittest.test("method--getIamPolicy", () {
1193
1194 var mock = new HttpServerMock(); 1200 var mock = new HttpServerMock();
1195 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1201 api.ProjectsSubscriptionsResourceApi res =
1202 new api.PubsubApi(mock).projects.subscriptions;
1196 var arg_resource = "foo"; 1203 var arg_resource = "foo";
1197 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1204 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1198 var path = (req.url).path; 1205 var path = (req.url).path;
1199 var pathOffset = 0; 1206 var pathOffset = 0;
1200 var index; 1207 var index;
1201 var subPart; 1208 var subPart;
1202 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1209 unittest.expect(
1210 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1203 pathOffset += 1; 1211 pathOffset += 1;
1204 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1212 unittest.expect(
1213 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1205 pathOffset += 3; 1214 pathOffset += 3;
1206 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1215 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1207 1216
1208 var query = (req.url).query; 1217 var query = (req.url).query;
1209 var queryOffset = 0; 1218 var queryOffset = 0;
1210 var queryMap = {}; 1219 var queryMap = {};
1211 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1220 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1212 parseBool(n) { 1221 parseBool(n) {
1213 if (n == "true") return true; 1222 if (n == "true") return true;
1214 if (n == "false") return false; 1223 if (n == "false") return false;
1215 if (n == null) return null; 1224 if (n == null) return null;
1216 throw new core.ArgumentError("Invalid boolean: $n"); 1225 throw new core.ArgumentError("Invalid boolean: $n");
1217 } 1226 }
1227
1218 if (query.length > 0) { 1228 if (query.length > 0) {
1219 for (var part in query.split("&")) { 1229 for (var part in query.split("&")) {
1220 var keyvalue = part.split("="); 1230 var keyvalue = part.split("=");
1221 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1231 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1232 core.Uri.decodeQueryComponent(keyvalue[1]));
1222 } 1233 }
1223 } 1234 }
1224 1235
1225
1226 var h = { 1236 var h = {
1227 "content-type" : "application/json; charset=utf-8", 1237 "content-type": "application/json; charset=utf-8",
1228 }; 1238 };
1229 var resp = convert.JSON.encode(buildPolicy()); 1239 var resp = convert.JSON.encode(buildPolicy());
1230 return new async.Future.value(stringResponse(200, h, resp)); 1240 return new async.Future.value(stringResponse(200, h, resp));
1231 }), true); 1241 }), true);
1232 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res ponse) { 1242 res
1243 .getIamPolicy(arg_resource)
1244 .then(unittest.expectAsync1(((api.Policy response) {
1233 checkPolicy(response); 1245 checkPolicy(response);
1234 }))); 1246 })));
1235 }); 1247 });
1236 1248
1237 unittest.test("method--list", () { 1249 unittest.test("method--list", () {
1238
1239 var mock = new HttpServerMock(); 1250 var mock = new HttpServerMock();
1240 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1251 api.ProjectsSubscriptionsResourceApi res =
1252 new api.PubsubApi(mock).projects.subscriptions;
1241 var arg_project = "foo"; 1253 var arg_project = "foo";
1254 var arg_pageSize = 42;
1242 var arg_pageToken = "foo"; 1255 var arg_pageToken = "foo";
1243 var arg_pageSize = 42;
1244 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1256 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1245 var path = (req.url).path; 1257 var path = (req.url).path;
1246 var pathOffset = 0; 1258 var pathOffset = 0;
1247 var index; 1259 var index;
1248 var subPart; 1260 var subPart;
1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1261 unittest.expect(
1262 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1250 pathOffset += 1; 1263 pathOffset += 1;
1251 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1264 unittest.expect(
1265 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1252 pathOffset += 3; 1266 pathOffset += 3;
1253 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1267 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1254 1268
1255 var query = (req.url).query; 1269 var query = (req.url).query;
1256 var queryOffset = 0; 1270 var queryOffset = 0;
1257 var queryMap = {}; 1271 var queryMap = {};
1258 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1272 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1259 parseBool(n) { 1273 parseBool(n) {
1260 if (n == "true") return true; 1274 if (n == "true") return true;
1261 if (n == "false") return false; 1275 if (n == "false") return false;
1262 if (n == null) return null; 1276 if (n == null) return null;
1263 throw new core.ArgumentError("Invalid boolean: $n"); 1277 throw new core.ArgumentError("Invalid boolean: $n");
1264 } 1278 }
1279
1265 if (query.length > 0) { 1280 if (query.length > 0) {
1266 for (var part in query.split("&")) { 1281 for (var part in query.split("&")) {
1267 var keyvalue = part.split("="); 1282 var keyvalue = part.split("=");
1268 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1283 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1284 core.Uri.decodeQueryComponent(keyvalue[1]));
1269 } 1285 }
1270 } 1286 }
1271 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 1287 unittest.expect(core.int.parse(queryMap["pageSize"].first),
1272 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 1288 unittest.equals(arg_pageSize));
1273 1289 unittest.expect(
1290 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
1274 1291
1275 var h = { 1292 var h = {
1276 "content-type" : "application/json; charset=utf-8", 1293 "content-type": "application/json; charset=utf-8",
1277 }; 1294 };
1278 var resp = convert.JSON.encode(buildListSubscriptionsResponse()); 1295 var resp = convert.JSON.encode(buildListSubscriptionsResponse());
1279 return new async.Future.value(stringResponse(200, h, resp)); 1296 return new async.Future.value(stringResponse(200, h, resp));
1280 }), true); 1297 }), true);
1281 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th en(unittest.expectAsync1(((api.ListSubscriptionsResponse response) { 1298 res
1299 .list(arg_project, pageSize: arg_pageSize, pageToken: arg_pageToken)
1300 .then(
1301 unittest.expectAsync1(((api.ListSubscriptionsResponse response) {
1282 checkListSubscriptionsResponse(response); 1302 checkListSubscriptionsResponse(response);
1283 }))); 1303 })));
1284 }); 1304 });
1285 1305
1286 unittest.test("method--modifyAckDeadline", () { 1306 unittest.test("method--modifyAckDeadline", () {
1287
1288 var mock = new HttpServerMock(); 1307 var mock = new HttpServerMock();
1289 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1308 api.ProjectsSubscriptionsResourceApi res =
1309 new api.PubsubApi(mock).projects.subscriptions;
1290 var arg_request = buildModifyAckDeadlineRequest(); 1310 var arg_request = buildModifyAckDeadlineRequest();
1291 var arg_subscription = "foo"; 1311 var arg_subscription = "foo";
1292 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1312 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1293 var obj = new api.ModifyAckDeadlineRequest.fromJson(json); 1313 var obj = new api.ModifyAckDeadlineRequest.fromJson(json);
1294 checkModifyAckDeadlineRequest(obj); 1314 checkModifyAckDeadlineRequest(obj);
1295 1315
1296 var path = (req.url).path; 1316 var path = (req.url).path;
1297 var pathOffset = 0; 1317 var pathOffset = 0;
1298 var index; 1318 var index;
1299 var subPart; 1319 var subPart;
1300 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1320 unittest.expect(
1321 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1301 pathOffset += 1; 1322 pathOffset += 1;
1302 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1323 unittest.expect(
1324 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1303 pathOffset += 3; 1325 pathOffset += 3;
1304 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1326 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1305 1327
1306 var query = (req.url).query; 1328 var query = (req.url).query;
1307 var queryOffset = 0; 1329 var queryOffset = 0;
1308 var queryMap = {}; 1330 var queryMap = {};
1309 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1331 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1310 parseBool(n) { 1332 parseBool(n) {
1311 if (n == "true") return true; 1333 if (n == "true") return true;
1312 if (n == "false") return false; 1334 if (n == "false") return false;
1313 if (n == null) return null; 1335 if (n == null) return null;
1314 throw new core.ArgumentError("Invalid boolean: $n"); 1336 throw new core.ArgumentError("Invalid boolean: $n");
1315 } 1337 }
1338
1316 if (query.length > 0) { 1339 if (query.length > 0) {
1317 for (var part in query.split("&")) { 1340 for (var part in query.split("&")) {
1318 var keyvalue = part.split("="); 1341 var keyvalue = part.split("=");
1319 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1342 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1343 core.Uri.decodeQueryComponent(keyvalue[1]));
1320 } 1344 }
1321 } 1345 }
1322 1346
1323
1324 var h = { 1347 var h = {
1325 "content-type" : "application/json; charset=utf-8", 1348 "content-type": "application/json; charset=utf-8",
1326 }; 1349 };
1327 var resp = convert.JSON.encode(buildEmpty()); 1350 var resp = convert.JSON.encode(buildEmpty());
1328 return new async.Future.value(stringResponse(200, h, resp)); 1351 return new async.Future.value(stringResponse(200, h, resp));
1329 }), true); 1352 }), true);
1330 res.modifyAckDeadline(arg_request, arg_subscription).then(unittest.expectA sync1(((api.Empty response) { 1353 res
1354 .modifyAckDeadline(arg_request, arg_subscription)
1355 .then(unittest.expectAsync1(((api.Empty response) {
1331 checkEmpty(response); 1356 checkEmpty(response);
1332 }))); 1357 })));
1333 }); 1358 });
1334 1359
1335 unittest.test("method--modifyPushConfig", () { 1360 unittest.test("method--modifyPushConfig", () {
1336
1337 var mock = new HttpServerMock(); 1361 var mock = new HttpServerMock();
1338 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1362 api.ProjectsSubscriptionsResourceApi res =
1363 new api.PubsubApi(mock).projects.subscriptions;
1339 var arg_request = buildModifyPushConfigRequest(); 1364 var arg_request = buildModifyPushConfigRequest();
1340 var arg_subscription = "foo"; 1365 var arg_subscription = "foo";
1341 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1366 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1342 var obj = new api.ModifyPushConfigRequest.fromJson(json); 1367 var obj = new api.ModifyPushConfigRequest.fromJson(json);
1343 checkModifyPushConfigRequest(obj); 1368 checkModifyPushConfigRequest(obj);
1344 1369
1345 var path = (req.url).path; 1370 var path = (req.url).path;
1346 var pathOffset = 0; 1371 var pathOffset = 0;
1347 var index; 1372 var index;
1348 var subPart; 1373 var subPart;
1349 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1374 unittest.expect(
1375 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1350 pathOffset += 1; 1376 pathOffset += 1;
1351 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1377 unittest.expect(
1378 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1352 pathOffset += 3; 1379 pathOffset += 3;
1353 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1380 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1354 1381
1355 var query = (req.url).query; 1382 var query = (req.url).query;
1356 var queryOffset = 0; 1383 var queryOffset = 0;
1357 var queryMap = {}; 1384 var queryMap = {};
1358 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1385 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1359 parseBool(n) { 1386 parseBool(n) {
1360 if (n == "true") return true; 1387 if (n == "true") return true;
1361 if (n == "false") return false; 1388 if (n == "false") return false;
1362 if (n == null) return null; 1389 if (n == null) return null;
1363 throw new core.ArgumentError("Invalid boolean: $n"); 1390 throw new core.ArgumentError("Invalid boolean: $n");
1364 } 1391 }
1392
1365 if (query.length > 0) { 1393 if (query.length > 0) {
1366 for (var part in query.split("&")) { 1394 for (var part in query.split("&")) {
1367 var keyvalue = part.split("="); 1395 var keyvalue = part.split("=");
1368 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1396 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1397 core.Uri.decodeQueryComponent(keyvalue[1]));
1369 } 1398 }
1370 } 1399 }
1371 1400
1372
1373 var h = { 1401 var h = {
1374 "content-type" : "application/json; charset=utf-8", 1402 "content-type": "application/json; charset=utf-8",
1375 }; 1403 };
1376 var resp = convert.JSON.encode(buildEmpty()); 1404 var resp = convert.JSON.encode(buildEmpty());
1377 return new async.Future.value(stringResponse(200, h, resp)); 1405 return new async.Future.value(stringResponse(200, h, resp));
1378 }), true); 1406 }), true);
1379 res.modifyPushConfig(arg_request, arg_subscription).then(unittest.expectAs ync1(((api.Empty response) { 1407 res
1408 .modifyPushConfig(arg_request, arg_subscription)
1409 .then(unittest.expectAsync1(((api.Empty response) {
1380 checkEmpty(response); 1410 checkEmpty(response);
1381 }))); 1411 })));
1382 }); 1412 });
1383 1413
1384 unittest.test("method--pull", () { 1414 unittest.test("method--pull", () {
1385
1386 var mock = new HttpServerMock(); 1415 var mock = new HttpServerMock();
1387 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1416 api.ProjectsSubscriptionsResourceApi res =
1417 new api.PubsubApi(mock).projects.subscriptions;
1388 var arg_request = buildPullRequest(); 1418 var arg_request = buildPullRequest();
1389 var arg_subscription = "foo"; 1419 var arg_subscription = "foo";
1390 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1420 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1391 var obj = new api.PullRequest.fromJson(json); 1421 var obj = new api.PullRequest.fromJson(json);
1392 checkPullRequest(obj); 1422 checkPullRequest(obj);
1393 1423
1394 var path = (req.url).path; 1424 var path = (req.url).path;
1395 var pathOffset = 0; 1425 var pathOffset = 0;
1396 var index; 1426 var index;
1397 var subPart; 1427 var subPart;
1398 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1428 unittest.expect(
1429 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1399 pathOffset += 1; 1430 pathOffset += 1;
1400 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1431 unittest.expect(
1432 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1401 pathOffset += 3; 1433 pathOffset += 3;
1402 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1434 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1403 1435
1404 var query = (req.url).query; 1436 var query = (req.url).query;
1405 var queryOffset = 0; 1437 var queryOffset = 0;
1406 var queryMap = {}; 1438 var queryMap = {};
1407 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1439 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1408 parseBool(n) { 1440 parseBool(n) {
1409 if (n == "true") return true; 1441 if (n == "true") return true;
1410 if (n == "false") return false; 1442 if (n == "false") return false;
1411 if (n == null) return null; 1443 if (n == null) return null;
1412 throw new core.ArgumentError("Invalid boolean: $n"); 1444 throw new core.ArgumentError("Invalid boolean: $n");
1413 } 1445 }
1446
1414 if (query.length > 0) { 1447 if (query.length > 0) {
1415 for (var part in query.split("&")) { 1448 for (var part in query.split("&")) {
1416 var keyvalue = part.split("="); 1449 var keyvalue = part.split("=");
1417 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1450 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1451 core.Uri.decodeQueryComponent(keyvalue[1]));
1418 } 1452 }
1419 } 1453 }
1420 1454
1421
1422 var h = { 1455 var h = {
1423 "content-type" : "application/json; charset=utf-8", 1456 "content-type": "application/json; charset=utf-8",
1424 }; 1457 };
1425 var resp = convert.JSON.encode(buildPullResponse()); 1458 var resp = convert.JSON.encode(buildPullResponse());
1426 return new async.Future.value(stringResponse(200, h, resp)); 1459 return new async.Future.value(stringResponse(200, h, resp));
1427 }), true); 1460 }), true);
1428 res.pull(arg_request, arg_subscription).then(unittest.expectAsync1(((api.P ullResponse response) { 1461 res
1462 .pull(arg_request, arg_subscription)
1463 .then(unittest.expectAsync1(((api.PullResponse response) {
1429 checkPullResponse(response); 1464 checkPullResponse(response);
1430 }))); 1465 })));
1431 }); 1466 });
1432 1467
1433 unittest.test("method--setIamPolicy", () { 1468 unittest.test("method--setIamPolicy", () {
1434
1435 var mock = new HttpServerMock(); 1469 var mock = new HttpServerMock();
1436 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1470 api.ProjectsSubscriptionsResourceApi res =
1471 new api.PubsubApi(mock).projects.subscriptions;
1437 var arg_request = buildSetIamPolicyRequest(); 1472 var arg_request = buildSetIamPolicyRequest();
1438 var arg_resource = "foo"; 1473 var arg_resource = "foo";
1439 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1474 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1440 var obj = new api.SetIamPolicyRequest.fromJson(json); 1475 var obj = new api.SetIamPolicyRequest.fromJson(json);
1441 checkSetIamPolicyRequest(obj); 1476 checkSetIamPolicyRequest(obj);
1442 1477
1443 var path = (req.url).path; 1478 var path = (req.url).path;
1444 var pathOffset = 0; 1479 var pathOffset = 0;
1445 var index; 1480 var index;
1446 var subPart; 1481 var subPart;
1447 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1482 unittest.expect(
1483 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1448 pathOffset += 1; 1484 pathOffset += 1;
1449 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1485 unittest.expect(
1486 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1450 pathOffset += 3; 1487 pathOffset += 3;
1451 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1488 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1452 1489
1453 var query = (req.url).query; 1490 var query = (req.url).query;
1454 var queryOffset = 0; 1491 var queryOffset = 0;
1455 var queryMap = {}; 1492 var queryMap = {};
1456 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1493 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1457 parseBool(n) { 1494 parseBool(n) {
1458 if (n == "true") return true; 1495 if (n == "true") return true;
1459 if (n == "false") return false; 1496 if (n == "false") return false;
1460 if (n == null) return null; 1497 if (n == null) return null;
1461 throw new core.ArgumentError("Invalid boolean: $n"); 1498 throw new core.ArgumentError("Invalid boolean: $n");
1462 } 1499 }
1500
1463 if (query.length > 0) { 1501 if (query.length > 0) {
1464 for (var part in query.split("&")) { 1502 for (var part in query.split("&")) {
1465 var keyvalue = part.split("="); 1503 var keyvalue = part.split("=");
1466 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1504 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1505 core.Uri.decodeQueryComponent(keyvalue[1]));
1467 } 1506 }
1468 } 1507 }
1469 1508
1470
1471 var h = { 1509 var h = {
1472 "content-type" : "application/json; charset=utf-8", 1510 "content-type": "application/json; charset=utf-8",
1473 }; 1511 };
1474 var resp = convert.JSON.encode(buildPolicy()); 1512 var resp = convert.JSON.encode(buildPolicy());
1475 return new async.Future.value(stringResponse(200, h, resp)); 1513 return new async.Future.value(stringResponse(200, h, resp));
1476 }), true); 1514 }), true);
1477 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 1515 res
1516 .setIamPolicy(arg_request, arg_resource)
1517 .then(unittest.expectAsync1(((api.Policy response) {
1478 checkPolicy(response); 1518 checkPolicy(response);
1479 }))); 1519 })));
1480 }); 1520 });
1481 1521
1482 unittest.test("method--testIamPermissions", () { 1522 unittest.test("method--testIamPermissions", () {
1483
1484 var mock = new HttpServerMock(); 1523 var mock = new HttpServerMock();
1485 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project s.subscriptions; 1524 api.ProjectsSubscriptionsResourceApi res =
1525 new api.PubsubApi(mock).projects.subscriptions;
1486 var arg_request = buildTestIamPermissionsRequest(); 1526 var arg_request = buildTestIamPermissionsRequest();
1487 var arg_resource = "foo"; 1527 var arg_resource = "foo";
1488 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1528 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1489 var obj = new api.TestIamPermissionsRequest.fromJson(json); 1529 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1490 checkTestIamPermissionsRequest(obj); 1530 checkTestIamPermissionsRequest(obj);
1491 1531
1492 var path = (req.url).path; 1532 var path = (req.url).path;
1493 var pathOffset = 0; 1533 var pathOffset = 0;
1494 var index; 1534 var index;
1495 var subPart; 1535 var subPart;
1496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1536 unittest.expect(
1537 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1497 pathOffset += 1; 1538 pathOffset += 1;
1498 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1539 unittest.expect(
1540 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1499 pathOffset += 3; 1541 pathOffset += 3;
1500 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1542 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1501 1543
1502 var query = (req.url).query; 1544 var query = (req.url).query;
1503 var queryOffset = 0; 1545 var queryOffset = 0;
1504 var queryMap = {}; 1546 var queryMap = {};
1505 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1547 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1506 parseBool(n) { 1548 parseBool(n) {
1507 if (n == "true") return true; 1549 if (n == "true") return true;
1508 if (n == "false") return false; 1550 if (n == "false") return false;
1509 if (n == null) return null; 1551 if (n == null) return null;
1510 throw new core.ArgumentError("Invalid boolean: $n"); 1552 throw new core.ArgumentError("Invalid boolean: $n");
1511 } 1553 }
1554
1512 if (query.length > 0) { 1555 if (query.length > 0) {
1513 for (var part in query.split("&")) { 1556 for (var part in query.split("&")) {
1514 var keyvalue = part.split("="); 1557 var keyvalue = part.split("=");
1515 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1558 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1559 core.Uri.decodeQueryComponent(keyvalue[1]));
1516 } 1560 }
1517 } 1561 }
1518 1562
1519
1520 var h = { 1563 var h = {
1521 "content-type" : "application/json; charset=utf-8", 1564 "content-type": "application/json; charset=utf-8",
1522 }; 1565 };
1523 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 1566 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1524 return new async.Future.value(stringResponse(200, h, resp)); 1567 return new async.Future.value(stringResponse(200, h, resp));
1525 }), true); 1568 }), true);
1526 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 1569 res.testIamPermissions(arg_request, arg_resource).then(
1570 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
1527 checkTestIamPermissionsResponse(response); 1571 checkTestIamPermissionsResponse(response);
1528 }))); 1572 })));
1529 }); 1573 });
1530
1531 }); 1574 });
1532 1575
1533
1534 unittest.group("resource-ProjectsTopicsResourceApi", () { 1576 unittest.group("resource-ProjectsTopicsResourceApi", () {
1535 unittest.test("method--create", () { 1577 unittest.test("method--create", () {
1536
1537 var mock = new HttpServerMock(); 1578 var mock = new HttpServerMock();
1538 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1579 api.ProjectsTopicsResourceApi res =
1580 new api.PubsubApi(mock).projects.topics;
1539 var arg_request = buildTopic(); 1581 var arg_request = buildTopic();
1540 var arg_name = "foo"; 1582 var arg_name = "foo";
1541 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1583 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1542 var obj = new api.Topic.fromJson(json); 1584 var obj = new api.Topic.fromJson(json);
1543 checkTopic(obj); 1585 checkTopic(obj);
1544 1586
1545 var path = (req.url).path; 1587 var path = (req.url).path;
1546 var pathOffset = 0; 1588 var pathOffset = 0;
1547 var index; 1589 var index;
1548 var subPart; 1590 var subPart;
1549 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1591 unittest.expect(
1592 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1550 pathOffset += 1; 1593 pathOffset += 1;
1551 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1594 unittest.expect(
1595 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1552 pathOffset += 3; 1596 pathOffset += 3;
1553 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1597 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1554 1598
1555 var query = (req.url).query; 1599 var query = (req.url).query;
1556 var queryOffset = 0; 1600 var queryOffset = 0;
1557 var queryMap = {}; 1601 var queryMap = {};
1558 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1602 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1559 parseBool(n) { 1603 parseBool(n) {
1560 if (n == "true") return true; 1604 if (n == "true") return true;
1561 if (n == "false") return false; 1605 if (n == "false") return false;
1562 if (n == null) return null; 1606 if (n == null) return null;
1563 throw new core.ArgumentError("Invalid boolean: $n"); 1607 throw new core.ArgumentError("Invalid boolean: $n");
1564 } 1608 }
1609
1565 if (query.length > 0) { 1610 if (query.length > 0) {
1566 for (var part in query.split("&")) { 1611 for (var part in query.split("&")) {
1567 var keyvalue = part.split("="); 1612 var keyvalue = part.split("=");
1568 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1613 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1614 core.Uri.decodeQueryComponent(keyvalue[1]));
1569 } 1615 }
1570 } 1616 }
1571 1617
1572
1573 var h = { 1618 var h = {
1574 "content-type" : "application/json; charset=utf-8", 1619 "content-type": "application/json; charset=utf-8",
1575 }; 1620 };
1576 var resp = convert.JSON.encode(buildTopic()); 1621 var resp = convert.JSON.encode(buildTopic());
1577 return new async.Future.value(stringResponse(200, h, resp)); 1622 return new async.Future.value(stringResponse(200, h, resp));
1578 }), true); 1623 }), true);
1579 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Topic r esponse) { 1624 res
1625 .create(arg_request, arg_name)
1626 .then(unittest.expectAsync1(((api.Topic response) {
1580 checkTopic(response); 1627 checkTopic(response);
1581 }))); 1628 })));
1582 }); 1629 });
1583 1630
1584 unittest.test("method--delete", () { 1631 unittest.test("method--delete", () {
1585
1586 var mock = new HttpServerMock(); 1632 var mock = new HttpServerMock();
1587 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1633 api.ProjectsTopicsResourceApi res =
1634 new api.PubsubApi(mock).projects.topics;
1588 var arg_topic = "foo"; 1635 var arg_topic = "foo";
1589 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1636 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1590 var path = (req.url).path; 1637 var path = (req.url).path;
1591 var pathOffset = 0; 1638 var pathOffset = 0;
1592 var index; 1639 var index;
1593 var subPart; 1640 var subPart;
1594 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1641 unittest.expect(
1642 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1595 pathOffset += 1; 1643 pathOffset += 1;
1596 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1644 unittest.expect(
1645 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1597 pathOffset += 3; 1646 pathOffset += 3;
1598 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1647 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1599 1648
1600 var query = (req.url).query; 1649 var query = (req.url).query;
1601 var queryOffset = 0; 1650 var queryOffset = 0;
1602 var queryMap = {}; 1651 var queryMap = {};
1603 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1652 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1604 parseBool(n) { 1653 parseBool(n) {
1605 if (n == "true") return true; 1654 if (n == "true") return true;
1606 if (n == "false") return false; 1655 if (n == "false") return false;
1607 if (n == null) return null; 1656 if (n == null) return null;
1608 throw new core.ArgumentError("Invalid boolean: $n"); 1657 throw new core.ArgumentError("Invalid boolean: $n");
1609 } 1658 }
1659
1610 if (query.length > 0) { 1660 if (query.length > 0) {
1611 for (var part in query.split("&")) { 1661 for (var part in query.split("&")) {
1612 var keyvalue = part.split("="); 1662 var keyvalue = part.split("=");
1613 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1663 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1664 core.Uri.decodeQueryComponent(keyvalue[1]));
1614 } 1665 }
1615 } 1666 }
1616 1667
1617
1618 var h = { 1668 var h = {
1619 "content-type" : "application/json; charset=utf-8", 1669 "content-type": "application/json; charset=utf-8",
1620 }; 1670 };
1621 var resp = convert.JSON.encode(buildEmpty()); 1671 var resp = convert.JSON.encode(buildEmpty());
1622 return new async.Future.value(stringResponse(200, h, resp)); 1672 return new async.Future.value(stringResponse(200, h, resp));
1623 }), true); 1673 }), true);
1624 res.delete(arg_topic).then(unittest.expectAsync1(((api.Empty response) { 1674 res.delete(arg_topic).then(unittest.expectAsync1(((api.Empty response) {
1625 checkEmpty(response); 1675 checkEmpty(response);
1626 }))); 1676 })));
1627 }); 1677 });
1628 1678
1629 unittest.test("method--get", () { 1679 unittest.test("method--get", () {
1630
1631 var mock = new HttpServerMock(); 1680 var mock = new HttpServerMock();
1632 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1681 api.ProjectsTopicsResourceApi res =
1682 new api.PubsubApi(mock).projects.topics;
1633 var arg_topic = "foo"; 1683 var arg_topic = "foo";
1634 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1684 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1635 var path = (req.url).path; 1685 var path = (req.url).path;
1636 var pathOffset = 0; 1686 var pathOffset = 0;
1637 var index; 1687 var index;
1638 var subPart; 1688 var subPart;
1639 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1689 unittest.expect(
1690 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1640 pathOffset += 1; 1691 pathOffset += 1;
1641 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1692 unittest.expect(
1693 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1642 pathOffset += 3; 1694 pathOffset += 3;
1643 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1695 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1644 1696
1645 var query = (req.url).query; 1697 var query = (req.url).query;
1646 var queryOffset = 0; 1698 var queryOffset = 0;
1647 var queryMap = {}; 1699 var queryMap = {};
1648 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1700 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1649 parseBool(n) { 1701 parseBool(n) {
1650 if (n == "true") return true; 1702 if (n == "true") return true;
1651 if (n == "false") return false; 1703 if (n == "false") return false;
1652 if (n == null) return null; 1704 if (n == null) return null;
1653 throw new core.ArgumentError("Invalid boolean: $n"); 1705 throw new core.ArgumentError("Invalid boolean: $n");
1654 } 1706 }
1707
1655 if (query.length > 0) { 1708 if (query.length > 0) {
1656 for (var part in query.split("&")) { 1709 for (var part in query.split("&")) {
1657 var keyvalue = part.split("="); 1710 var keyvalue = part.split("=");
1658 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1711 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1712 core.Uri.decodeQueryComponent(keyvalue[1]));
1659 } 1713 }
1660 } 1714 }
1661 1715
1662
1663 var h = { 1716 var h = {
1664 "content-type" : "application/json; charset=utf-8", 1717 "content-type": "application/json; charset=utf-8",
1665 }; 1718 };
1666 var resp = convert.JSON.encode(buildTopic()); 1719 var resp = convert.JSON.encode(buildTopic());
1667 return new async.Future.value(stringResponse(200, h, resp)); 1720 return new async.Future.value(stringResponse(200, h, resp));
1668 }), true); 1721 }), true);
1669 res.get(arg_topic).then(unittest.expectAsync1(((api.Topic response) { 1722 res.get(arg_topic).then(unittest.expectAsync1(((api.Topic response) {
1670 checkTopic(response); 1723 checkTopic(response);
1671 }))); 1724 })));
1672 }); 1725 });
1673 1726
1674 unittest.test("method--getIamPolicy", () { 1727 unittest.test("method--getIamPolicy", () {
1675
1676 var mock = new HttpServerMock(); 1728 var mock = new HttpServerMock();
1677 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1729 api.ProjectsTopicsResourceApi res =
1730 new api.PubsubApi(mock).projects.topics;
1678 var arg_resource = "foo"; 1731 var arg_resource = "foo";
1679 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1732 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1680 var path = (req.url).path; 1733 var path = (req.url).path;
1681 var pathOffset = 0; 1734 var pathOffset = 0;
1682 var index; 1735 var index;
1683 var subPart; 1736 var subPart;
1684 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1737 unittest.expect(
1738 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1685 pathOffset += 1; 1739 pathOffset += 1;
1686 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1740 unittest.expect(
1741 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1687 pathOffset += 3; 1742 pathOffset += 3;
1688 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1743 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1689 1744
1690 var query = (req.url).query; 1745 var query = (req.url).query;
1691 var queryOffset = 0; 1746 var queryOffset = 0;
1692 var queryMap = {}; 1747 var queryMap = {};
1693 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1748 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1694 parseBool(n) { 1749 parseBool(n) {
1695 if (n == "true") return true; 1750 if (n == "true") return true;
1696 if (n == "false") return false; 1751 if (n == "false") return false;
1697 if (n == null) return null; 1752 if (n == null) return null;
1698 throw new core.ArgumentError("Invalid boolean: $n"); 1753 throw new core.ArgumentError("Invalid boolean: $n");
1699 } 1754 }
1755
1700 if (query.length > 0) { 1756 if (query.length > 0) {
1701 for (var part in query.split("&")) { 1757 for (var part in query.split("&")) {
1702 var keyvalue = part.split("="); 1758 var keyvalue = part.split("=");
1703 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1759 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1760 core.Uri.decodeQueryComponent(keyvalue[1]));
1704 } 1761 }
1705 } 1762 }
1706 1763
1707
1708 var h = { 1764 var h = {
1709 "content-type" : "application/json; charset=utf-8", 1765 "content-type": "application/json; charset=utf-8",
1710 }; 1766 };
1711 var resp = convert.JSON.encode(buildPolicy()); 1767 var resp = convert.JSON.encode(buildPolicy());
1712 return new async.Future.value(stringResponse(200, h, resp)); 1768 return new async.Future.value(stringResponse(200, h, resp));
1713 }), true); 1769 }), true);
1714 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res ponse) { 1770 res
1771 .getIamPolicy(arg_resource)
1772 .then(unittest.expectAsync1(((api.Policy response) {
1715 checkPolicy(response); 1773 checkPolicy(response);
1716 }))); 1774 })));
1717 }); 1775 });
1718 1776
1719 unittest.test("method--list", () { 1777 unittest.test("method--list", () {
1720
1721 var mock = new HttpServerMock(); 1778 var mock = new HttpServerMock();
1722 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1779 api.ProjectsTopicsResourceApi res =
1780 new api.PubsubApi(mock).projects.topics;
1723 var arg_project = "foo"; 1781 var arg_project = "foo";
1724 var arg_pageToken = "foo"; 1782 var arg_pageToken = "foo";
1725 var arg_pageSize = 42; 1783 var arg_pageSize = 42;
1726 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1784 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1727 var path = (req.url).path; 1785 var path = (req.url).path;
1728 var pathOffset = 0; 1786 var pathOffset = 0;
1729 var index; 1787 var index;
1730 var subPart; 1788 var subPart;
1731 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1789 unittest.expect(
1790 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1732 pathOffset += 1; 1791 pathOffset += 1;
1733 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1792 unittest.expect(
1793 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1734 pathOffset += 3; 1794 pathOffset += 3;
1735 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1795 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1736 1796
1737 var query = (req.url).query; 1797 var query = (req.url).query;
1738 var queryOffset = 0; 1798 var queryOffset = 0;
1739 var queryMap = {}; 1799 var queryMap = {};
1740 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1800 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1741 parseBool(n) { 1801 parseBool(n) {
1742 if (n == "true") return true; 1802 if (n == "true") return true;
1743 if (n == "false") return false; 1803 if (n == "false") return false;
1744 if (n == null) return null; 1804 if (n == null) return null;
1745 throw new core.ArgumentError("Invalid boolean: $n"); 1805 throw new core.ArgumentError("Invalid boolean: $n");
1746 } 1806 }
1807
1747 if (query.length > 0) { 1808 if (query.length > 0) {
1748 for (var part in query.split("&")) { 1809 for (var part in query.split("&")) {
1749 var keyvalue = part.split("="); 1810 var keyvalue = part.split("=");
1750 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1811 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1812 core.Uri.decodeQueryComponent(keyvalue[1]));
1751 } 1813 }
1752 } 1814 }
1753 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 1815 unittest.expect(
1754 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 1816 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
1755 1817 unittest.expect(core.int.parse(queryMap["pageSize"].first),
1818 unittest.equals(arg_pageSize));
1756 1819
1757 var h = { 1820 var h = {
1758 "content-type" : "application/json; charset=utf-8", 1821 "content-type": "application/json; charset=utf-8",
1759 }; 1822 };
1760 var resp = convert.JSON.encode(buildListTopicsResponse()); 1823 var resp = convert.JSON.encode(buildListTopicsResponse());
1761 return new async.Future.value(stringResponse(200, h, resp)); 1824 return new async.Future.value(stringResponse(200, h, resp));
1762 }), true); 1825 }), true);
1763 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th en(unittest.expectAsync1(((api.ListTopicsResponse response) { 1826 res
1827 .list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize)
1828 .then(unittest.expectAsync1(((api.ListTopicsResponse response) {
1764 checkListTopicsResponse(response); 1829 checkListTopicsResponse(response);
1765 }))); 1830 })));
1766 }); 1831 });
1767 1832
1768 unittest.test("method--publish", () { 1833 unittest.test("method--publish", () {
1769
1770 var mock = new HttpServerMock(); 1834 var mock = new HttpServerMock();
1771 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1835 api.ProjectsTopicsResourceApi res =
1836 new api.PubsubApi(mock).projects.topics;
1772 var arg_request = buildPublishRequest(); 1837 var arg_request = buildPublishRequest();
1773 var arg_topic = "foo"; 1838 var arg_topic = "foo";
1774 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1839 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1775 var obj = new api.PublishRequest.fromJson(json); 1840 var obj = new api.PublishRequest.fromJson(json);
1776 checkPublishRequest(obj); 1841 checkPublishRequest(obj);
1777 1842
1778 var path = (req.url).path; 1843 var path = (req.url).path;
1779 var pathOffset = 0; 1844 var pathOffset = 0;
1780 var index; 1845 var index;
1781 var subPart; 1846 var subPart;
1782 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1847 unittest.expect(
1848 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1783 pathOffset += 1; 1849 pathOffset += 1;
1784 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1850 unittest.expect(
1851 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1785 pathOffset += 3; 1852 pathOffset += 3;
1786 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1853 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1787 1854
1788 var query = (req.url).query; 1855 var query = (req.url).query;
1789 var queryOffset = 0; 1856 var queryOffset = 0;
1790 var queryMap = {}; 1857 var queryMap = {};
1791 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1858 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1792 parseBool(n) { 1859 parseBool(n) {
1793 if (n == "true") return true; 1860 if (n == "true") return true;
1794 if (n == "false") return false; 1861 if (n == "false") return false;
1795 if (n == null) return null; 1862 if (n == null) return null;
1796 throw new core.ArgumentError("Invalid boolean: $n"); 1863 throw new core.ArgumentError("Invalid boolean: $n");
1797 } 1864 }
1865
1798 if (query.length > 0) { 1866 if (query.length > 0) {
1799 for (var part in query.split("&")) { 1867 for (var part in query.split("&")) {
1800 var keyvalue = part.split("="); 1868 var keyvalue = part.split("=");
1801 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1869 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1870 core.Uri.decodeQueryComponent(keyvalue[1]));
1802 } 1871 }
1803 } 1872 }
1804 1873
1805
1806 var h = { 1874 var h = {
1807 "content-type" : "application/json; charset=utf-8", 1875 "content-type": "application/json; charset=utf-8",
1808 }; 1876 };
1809 var resp = convert.JSON.encode(buildPublishResponse()); 1877 var resp = convert.JSON.encode(buildPublishResponse());
1810 return new async.Future.value(stringResponse(200, h, resp)); 1878 return new async.Future.value(stringResponse(200, h, resp));
1811 }), true); 1879 }), true);
1812 res.publish(arg_request, arg_topic).then(unittest.expectAsync1(((api.Publi shResponse response) { 1880 res
1881 .publish(arg_request, arg_topic)
1882 .then(unittest.expectAsync1(((api.PublishResponse response) {
1813 checkPublishResponse(response); 1883 checkPublishResponse(response);
1814 }))); 1884 })));
1815 }); 1885 });
1816 1886
1817 unittest.test("method--setIamPolicy", () { 1887 unittest.test("method--setIamPolicy", () {
1818
1819 var mock = new HttpServerMock(); 1888 var mock = new HttpServerMock();
1820 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1889 api.ProjectsTopicsResourceApi res =
1890 new api.PubsubApi(mock).projects.topics;
1821 var arg_request = buildSetIamPolicyRequest(); 1891 var arg_request = buildSetIamPolicyRequest();
1822 var arg_resource = "foo"; 1892 var arg_resource = "foo";
1823 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1893 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1824 var obj = new api.SetIamPolicyRequest.fromJson(json); 1894 var obj = new api.SetIamPolicyRequest.fromJson(json);
1825 checkSetIamPolicyRequest(obj); 1895 checkSetIamPolicyRequest(obj);
1826 1896
1827 var path = (req.url).path; 1897 var path = (req.url).path;
1828 var pathOffset = 0; 1898 var pathOffset = 0;
1829 var index; 1899 var index;
1830 var subPart; 1900 var subPart;
1831 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1901 unittest.expect(
1902 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1832 pathOffset += 1; 1903 pathOffset += 1;
1833 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1904 unittest.expect(
1905 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1834 pathOffset += 3; 1906 pathOffset += 3;
1835 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1907 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1836 1908
1837 var query = (req.url).query; 1909 var query = (req.url).query;
1838 var queryOffset = 0; 1910 var queryOffset = 0;
1839 var queryMap = {}; 1911 var queryMap = {};
1840 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1912 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1841 parseBool(n) { 1913 parseBool(n) {
1842 if (n == "true") return true; 1914 if (n == "true") return true;
1843 if (n == "false") return false; 1915 if (n == "false") return false;
1844 if (n == null) return null; 1916 if (n == null) return null;
1845 throw new core.ArgumentError("Invalid boolean: $n"); 1917 throw new core.ArgumentError("Invalid boolean: $n");
1846 } 1918 }
1919
1847 if (query.length > 0) { 1920 if (query.length > 0) {
1848 for (var part in query.split("&")) { 1921 for (var part in query.split("&")) {
1849 var keyvalue = part.split("="); 1922 var keyvalue = part.split("=");
1850 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1923 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1924 core.Uri.decodeQueryComponent(keyvalue[1]));
1851 } 1925 }
1852 } 1926 }
1853 1927
1854
1855 var h = { 1928 var h = {
1856 "content-type" : "application/json; charset=utf-8", 1929 "content-type": "application/json; charset=utf-8",
1857 }; 1930 };
1858 var resp = convert.JSON.encode(buildPolicy()); 1931 var resp = convert.JSON.encode(buildPolicy());
1859 return new async.Future.value(stringResponse(200, h, resp)); 1932 return new async.Future.value(stringResponse(200, h, resp));
1860 }), true); 1933 }), true);
1861 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 1934 res
1935 .setIamPolicy(arg_request, arg_resource)
1936 .then(unittest.expectAsync1(((api.Policy response) {
1862 checkPolicy(response); 1937 checkPolicy(response);
1863 }))); 1938 })));
1864 }); 1939 });
1865 1940
1866 unittest.test("method--testIamPermissions", () { 1941 unittest.test("method--testIamPermissions", () {
1867
1868 var mock = new HttpServerMock(); 1942 var mock = new HttpServerMock();
1869 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic s; 1943 api.ProjectsTopicsResourceApi res =
1944 new api.PubsubApi(mock).projects.topics;
1870 var arg_request = buildTestIamPermissionsRequest(); 1945 var arg_request = buildTestIamPermissionsRequest();
1871 var arg_resource = "foo"; 1946 var arg_resource = "foo";
1872 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1947 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1873 var obj = new api.TestIamPermissionsRequest.fromJson(json); 1948 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1874 checkTestIamPermissionsRequest(obj); 1949 checkTestIamPermissionsRequest(obj);
1875 1950
1876 var path = (req.url).path; 1951 var path = (req.url).path;
1877 var pathOffset = 0; 1952 var pathOffset = 0;
1878 var index; 1953 var index;
1879 var subPart; 1954 var subPart;
1880 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1955 unittest.expect(
1956 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1881 pathOffset += 1; 1957 pathOffset += 1;
1882 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 1958 unittest.expect(
1959 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1883 pathOffset += 3; 1960 pathOffset += 3;
1884 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1961 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1885 1962
1886 var query = (req.url).query; 1963 var query = (req.url).query;
1887 var queryOffset = 0; 1964 var queryOffset = 0;
1888 var queryMap = {}; 1965 var queryMap = {};
1889 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1966 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1890 parseBool(n) { 1967 parseBool(n) {
1891 if (n == "true") return true; 1968 if (n == "true") return true;
1892 if (n == "false") return false; 1969 if (n == "false") return false;
1893 if (n == null) return null; 1970 if (n == null) return null;
1894 throw new core.ArgumentError("Invalid boolean: $n"); 1971 throw new core.ArgumentError("Invalid boolean: $n");
1895 } 1972 }
1973
1896 if (query.length > 0) { 1974 if (query.length > 0) {
1897 for (var part in query.split("&")) { 1975 for (var part in query.split("&")) {
1898 var keyvalue = part.split("="); 1976 var keyvalue = part.split("=");
1899 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1977 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1978 core.Uri.decodeQueryComponent(keyvalue[1]));
1900 } 1979 }
1901 } 1980 }
1902 1981
1903
1904 var h = { 1982 var h = {
1905 "content-type" : "application/json; charset=utf-8", 1983 "content-type": "application/json; charset=utf-8",
1906 }; 1984 };
1907 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 1985 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1908 return new async.Future.value(stringResponse(200, h, resp)); 1986 return new async.Future.value(stringResponse(200, h, resp));
1909 }), true); 1987 }), true);
1910 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 1988 res.testIamPermissions(arg_request, arg_resource).then(
1989 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
1911 checkTestIamPermissionsResponse(response); 1990 checkTestIamPermissionsResponse(response);
1912 }))); 1991 })));
1913 }); 1992 });
1914
1915 }); 1993 });
1916 1994
1917
1918 unittest.group("resource-ProjectsTopicsSubscriptionsResourceApi", () { 1995 unittest.group("resource-ProjectsTopicsSubscriptionsResourceApi", () {
1919 unittest.test("method--list", () { 1996 unittest.test("method--list", () {
1920
1921 var mock = new HttpServerMock(); 1997 var mock = new HttpServerMock();
1922 api.ProjectsTopicsSubscriptionsResourceApi res = new api.PubsubApi(mock).p rojects.topics.subscriptions; 1998 api.ProjectsTopicsSubscriptionsResourceApi res =
1999 new api.PubsubApi(mock).projects.topics.subscriptions;
1923 var arg_topic = "foo"; 2000 var arg_topic = "foo";
2001 var arg_pageToken = "foo";
1924 var arg_pageSize = 42; 2002 var arg_pageSize = 42;
1925 var arg_pageToken = "foo";
1926 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 2003 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1927 var path = (req.url).path; 2004 var path = (req.url).path;
1928 var pathOffset = 0; 2005 var pathOffset = 0;
1929 var index; 2006 var index;
1930 var subPart; 2007 var subPart;
1931 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 2008 unittest.expect(
2009 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1932 pathOffset += 1; 2010 pathOffset += 1;
1933 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ als("v1/")); 2011 unittest.expect(
2012 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/"));
1934 pathOffset += 3; 2013 pathOffset += 3;
1935 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 2014 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1936 2015
1937 var query = (req.url).query; 2016 var query = (req.url).query;
1938 var queryOffset = 0; 2017 var queryOffset = 0;
1939 var queryMap = {}; 2018 var queryMap = {};
1940 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 2019 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1941 parseBool(n) { 2020 parseBool(n) {
1942 if (n == "true") return true; 2021 if (n == "true") return true;
1943 if (n == "false") return false; 2022 if (n == "false") return false;
1944 if (n == null) return null; 2023 if (n == null) return null;
1945 throw new core.ArgumentError("Invalid boolean: $n"); 2024 throw new core.ArgumentError("Invalid boolean: $n");
1946 } 2025 }
2026
1947 if (query.length > 0) { 2027 if (query.length > 0) {
1948 for (var part in query.split("&")) { 2028 for (var part in query.split("&")) {
1949 var keyvalue = part.split("="); 2029 var keyvalue = part.split("=");
1950 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 2030 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2031 core.Uri.decodeQueryComponent(keyvalue[1]));
1951 } 2032 }
1952 } 2033 }
1953 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 2034 unittest.expect(
1954 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 2035 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
1955 2036 unittest.expect(core.int.parse(queryMap["pageSize"].first),
2037 unittest.equals(arg_pageSize));
1956 2038
1957 var h = { 2039 var h = {
1958 "content-type" : "application/json; charset=utf-8", 2040 "content-type": "application/json; charset=utf-8",
1959 }; 2041 };
1960 var resp = convert.JSON.encode(buildListTopicSubscriptionsResponse()); 2042 var resp = convert.JSON.encode(buildListTopicSubscriptionsResponse());
1961 return new async.Future.value(stringResponse(200, h, resp)); 2043 return new async.Future.value(stringResponse(200, h, resp));
1962 }), true); 2044 }), true);
1963 res.list(arg_topic, pageSize: arg_pageSize, pageToken: arg_pageToken).then (unittest.expectAsync1(((api.ListTopicSubscriptionsResponse response) { 2045 res
2046 .list(arg_topic, pageToken: arg_pageToken, pageSize: arg_pageSize)
2047 .then(unittest
2048 .expectAsync1(((api.ListTopicSubscriptionsResponse response) {
1964 checkListTopicSubscriptionsResponse(response); 2049 checkListTopicSubscriptionsResponse(response);
1965 }))); 2050 })));
1966 }); 2051 });
1967
1968 }); 2052 });
1969
1970
1971 } 2053 }
1972
OLDNEW
« no previous file with comments | « generated/googleapis/test/prediction/v1_6_test.dart ('k') | generated/googleapis/test/qpxexpress/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698