| Index: generated/googleapis/test/cloudtrace/v1_test.dart
|
| diff --git a/generated/googleapis/test/cloudtrace/v1_test.dart b/generated/googleapis/test/cloudtrace/v1_test.dart
|
| index 418fb4e450784c966a8b2261967169708ccc33a3..a92a36c926d7e075d1aa2ebc2064f419cd984004 100644
|
| --- a/generated/googleapis/test/cloudtrace/v1_test.dart
|
| +++ b/generated/googleapis/test/cloudtrace/v1_test.dart
|
| @@ -1,12 +1,10 @@
|
| library googleapis.cloudtrace.v1.test;
|
|
|
| import "dart:core" as core;
|
| -import "dart:collection" as collection;
|
| import "dart:async" as async;
|
| import "dart:convert" as convert;
|
|
|
| import 'package:http/http.dart' as http;
|
| -import 'package:http/testing.dart' as http_testing;
|
| import 'package:test/test.dart' as unittest;
|
|
|
| import 'package:googleapis/cloudtrace/v1.dart' as api;
|
| @@ -22,7 +20,8 @@ class HttpServerMock extends http.BaseClient {
|
|
|
| async.Future<http.StreamedResponse> send(http.BaseRequest request) {
|
| if (_expectJson) {
|
| - return request.finalize()
|
| + return request
|
| + .finalize()
|
| .transform(convert.UTF8.decoder)
|
| .join('')
|
| .then((core.String jsonString) {
|
| @@ -45,8 +44,8 @@ class HttpServerMock extends http.BaseClient {
|
| }
|
| }
|
|
|
| -http.StreamedResponse stringResponse(
|
| - core.int status, core.Map<core.String, core.String> headers, core.String body) {
|
| +http.StreamedResponse stringResponse(core.int status,
|
| + core.Map<core.String, core.String> headers, core.String body) {
|
| var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
|
| return new http.StreamedResponse(stream, status, headers: headers);
|
| }
|
| @@ -55,27 +54,25 @@ core.int buildCounterEmpty = 0;
|
| buildEmpty() {
|
| var o = new api.Empty();
|
| buildCounterEmpty++;
|
| - if (buildCounterEmpty < 3) {
|
| - }
|
| + if (buildCounterEmpty < 3) {}
|
| buildCounterEmpty--;
|
| return o;
|
| }
|
|
|
| checkEmpty(api.Empty o) {
|
| buildCounterEmpty++;
|
| - if (buildCounterEmpty < 3) {
|
| - }
|
| + if (buildCounterEmpty < 3) {}
|
| buildCounterEmpty--;
|
| }
|
|
|
| -buildUnnamed210() {
|
| +buildUnnamed205() {
|
| var o = new core.List<api.Trace>();
|
| o.add(buildTrace());
|
| o.add(buildTrace());
|
| return o;
|
| }
|
|
|
| -checkUnnamed210(core.List<api.Trace> o) {
|
| +checkUnnamed205(core.List<api.Trace> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkTrace(o[0]);
|
| checkTrace(o[1]);
|
| @@ -87,7 +84,7 @@ buildListTracesResponse() {
|
| buildCounterListTracesResponse++;
|
| if (buildCounterListTracesResponse < 3) {
|
| o.nextPageToken = "foo";
|
| - o.traces = buildUnnamed210();
|
| + o.traces = buildUnnamed205();
|
| }
|
| buildCounterListTracesResponse--;
|
| return o;
|
| @@ -97,19 +94,19 @@ checkListTracesResponse(api.ListTracesResponse o) {
|
| buildCounterListTracesResponse++;
|
| if (buildCounterListTracesResponse < 3) {
|
| unittest.expect(o.nextPageToken, unittest.equals('foo'));
|
| - checkUnnamed210(o.traces);
|
| + checkUnnamed205(o.traces);
|
| }
|
| buildCounterListTracesResponse--;
|
| }
|
|
|
| -buildUnnamed211() {
|
| +buildUnnamed206() {
|
| var o = new core.List<api.TraceSpan>();
|
| o.add(buildTraceSpan());
|
| o.add(buildTraceSpan());
|
| return o;
|
| }
|
|
|
| -checkUnnamed211(core.List<api.TraceSpan> o) {
|
| +checkUnnamed206(core.List<api.TraceSpan> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkTraceSpan(o[0]);
|
| checkTraceSpan(o[1]);
|
| @@ -121,7 +118,7 @@ buildTrace() {
|
| buildCounterTrace++;
|
| if (buildCounterTrace < 3) {
|
| o.projectId = "foo";
|
| - o.spans = buildUnnamed211();
|
| + o.spans = buildUnnamed206();
|
| o.traceId = "foo";
|
| }
|
| buildCounterTrace--;
|
| @@ -132,20 +129,20 @@ checkTrace(api.Trace o) {
|
| buildCounterTrace++;
|
| if (buildCounterTrace < 3) {
|
| unittest.expect(o.projectId, unittest.equals('foo'));
|
| - checkUnnamed211(o.spans);
|
| + checkUnnamed206(o.spans);
|
| unittest.expect(o.traceId, unittest.equals('foo'));
|
| }
|
| buildCounterTrace--;
|
| }
|
|
|
| -buildUnnamed212() {
|
| +buildUnnamed207() {
|
| var o = new core.Map<core.String, core.String>();
|
| o["x"] = "foo";
|
| o["y"] = "foo";
|
| return o;
|
| }
|
|
|
| -checkUnnamed212(core.Map<core.String, core.String> o) {
|
| +checkUnnamed207(core.Map<core.String, core.String> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| unittest.expect(o["x"], unittest.equals('foo'));
|
| unittest.expect(o["y"], unittest.equals('foo'));
|
| @@ -158,7 +155,7 @@ buildTraceSpan() {
|
| if (buildCounterTraceSpan < 3) {
|
| o.endTime = "foo";
|
| o.kind = "foo";
|
| - o.labels = buildUnnamed212();
|
| + o.labels = buildUnnamed207();
|
| o.name = "foo";
|
| o.parentSpanId = "foo";
|
| o.spanId = "foo";
|
| @@ -173,7 +170,7 @@ checkTraceSpan(api.TraceSpan o) {
|
| if (buildCounterTraceSpan < 3) {
|
| unittest.expect(o.endTime, unittest.equals('foo'));
|
| unittest.expect(o.kind, unittest.equals('foo'));
|
| - checkUnnamed212(o.labels);
|
| + checkUnnamed207(o.labels);
|
| unittest.expect(o.name, unittest.equals('foo'));
|
| unittest.expect(o.parentSpanId, unittest.equals('foo'));
|
| unittest.expect(o.spanId, unittest.equals('foo'));
|
| @@ -182,14 +179,14 @@ checkTraceSpan(api.TraceSpan o) {
|
| buildCounterTraceSpan--;
|
| }
|
|
|
| -buildUnnamed213() {
|
| +buildUnnamed208() {
|
| var o = new core.List<api.Trace>();
|
| o.add(buildTrace());
|
| o.add(buildTrace());
|
| return o;
|
| }
|
|
|
| -checkUnnamed213(core.List<api.Trace> o) {
|
| +checkUnnamed208(core.List<api.Trace> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkTrace(o[0]);
|
| checkTrace(o[1]);
|
| @@ -200,7 +197,7 @@ buildTraces() {
|
| var o = new api.Traces();
|
| buildCounterTraces++;
|
| if (buildCounterTraces < 3) {
|
| - o.traces = buildUnnamed213();
|
| + o.traces = buildUnnamed208();
|
| }
|
| buildCounterTraces--;
|
| return o;
|
| @@ -209,12 +206,11 @@ buildTraces() {
|
| checkTraces(api.Traces o) {
|
| buildCounterTraces++;
|
| if (buildCounterTraces < 3) {
|
| - checkUnnamed213(o.traces);
|
| + checkUnnamed208(o.traces);
|
| }
|
| buildCounterTraces--;
|
| }
|
|
|
| -
|
| main() {
|
| unittest.group("obj-schema-Empty", () {
|
| unittest.test("to-json--from-json", () {
|
| @@ -224,7 +220,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-ListTracesResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildListTracesResponse();
|
| @@ -233,7 +228,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Trace", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildTrace();
|
| @@ -242,7 +236,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-TraceSpan", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildTraceSpan();
|
| @@ -251,7 +244,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Traces", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildTraces();
|
| @@ -260,10 +252,8 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("resource-ProjectsResourceApi", () {
|
| unittest.test("method--patchTraces", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.ProjectsResourceApi res = new api.CloudtraceApi(mock).projects;
|
| var arg_request = buildTraces();
|
| @@ -276,16 +266,20 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("v1/projects/"));
|
| pathOffset += 12;
|
| index = path.indexOf("/traces", pathOffset);
|
| unittest.expect(index >= 0, unittest.isTrue);
|
| - subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| + subPart =
|
| + core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| pathOffset = index;
|
| unittest.expect(subPart, unittest.equals("$arg_projectId"));
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("/traces"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("/traces"));
|
| pathOffset += 7;
|
|
|
| var query = (req.url).query;
|
| @@ -298,33 +292,34 @@ main() {
|
| if (n == null) return null;
|
| throw new core.ArgumentError("Invalid boolean: $n");
|
| }
|
| +
|
| if (query.length > 0) {
|
| for (var part in query.split("&")) {
|
| var keyvalue = part.split("=");
|
| - addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildEmpty());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.patchTraces(arg_request, arg_projectId).then(unittest.expectAsync1(((api.Empty response) {
|
| + res
|
| + .patchTraces(arg_request, arg_projectId)
|
| + .then(unittest.expectAsync1(((api.Empty response) {
|
| checkEmpty(response);
|
| })));
|
| });
|
| -
|
| });
|
|
|
| -
|
| unittest.group("resource-ProjectsTracesResourceApi", () {
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| - api.ProjectsTracesResourceApi res = new api.CloudtraceApi(mock).projects.traces;
|
| + api.ProjectsTracesResourceApi res =
|
| + new api.CloudtraceApi(mock).projects.traces;
|
| var arg_projectId = "foo";
|
| var arg_traceId = "foo";
|
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
|
| @@ -332,16 +327,20 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("v1/projects/"));
|
| pathOffset += 12;
|
| index = path.indexOf("/traces/", pathOffset);
|
| unittest.expect(index >= 0, unittest.isTrue);
|
| - subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| + subPart =
|
| + core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| pathOffset = index;
|
| unittest.expect(subPart, unittest.equals("$arg_projectId"));
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("/traces/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 8),
|
| + unittest.equals("/traces/"));
|
| pathOffset += 8;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -357,34 +356,37 @@ main() {
|
| if (n == null) return null;
|
| throw new core.ArgumentError("Invalid boolean: $n");
|
| }
|
| +
|
| if (query.length > 0) {
|
| for (var part in query.split("&")) {
|
| var keyvalue = part.split("=");
|
| - addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
|
|
| -
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildTrace());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.get(arg_projectId, arg_traceId).then(unittest.expectAsync1(((api.Trace response) {
|
| + res
|
| + .get(arg_projectId, arg_traceId)
|
| + .then(unittest.expectAsync1(((api.Trace response) {
|
| checkTrace(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--list", () {
|
| -
|
| var mock = new HttpServerMock();
|
| - api.ProjectsTracesResourceApi res = new api.CloudtraceApi(mock).projects.traces;
|
| + api.ProjectsTracesResourceApi res =
|
| + new api.CloudtraceApi(mock).projects.traces;
|
| var arg_projectId = "foo";
|
| var arg_filter = "foo";
|
| var arg_endTime = "foo";
|
| - var arg_pageToken = "foo";
|
| var arg_startTime = "foo";
|
| + var arg_pageToken = "foo";
|
| var arg_pageSize = 42;
|
| var arg_view = "foo";
|
| var arg_orderBy = "foo";
|
| @@ -393,16 +395,20 @@ main() {
|
| var pathOffset = 0;
|
| var index;
|
| var subPart;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| + unittest.expect(
|
| + path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
|
| pathOffset += 1;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("v1/projects/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("v1/projects/"));
|
| pathOffset += 12;
|
| index = path.indexOf("/traces", pathOffset);
|
| unittest.expect(index >= 0, unittest.isTrue);
|
| - subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| + subPart =
|
| + core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
|
| pathOffset = index;
|
| unittest.expect(subPart, unittest.equals("$arg_projectId"));
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("/traces"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("/traces"));
|
| pathOffset += 7;
|
|
|
| var query = (req.url).query;
|
| @@ -415,34 +421,45 @@ main() {
|
| if (n == null) return null;
|
| throw new core.ArgumentError("Invalid boolean: $n");
|
| }
|
| +
|
| if (query.length > 0) {
|
| for (var part in query.split("&")) {
|
| var keyvalue = part.split("=");
|
| - addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1]));
|
| + addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
|
| + core.Uri.decodeQueryComponent(keyvalue[1]));
|
| }
|
| }
|
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
|
| - unittest.expect(queryMap["endTime"].first, unittest.equals(arg_endTime));
|
| - unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken));
|
| - unittest.expect(queryMap["startTime"].first, unittest.equals(arg_startTime));
|
| - unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equals(arg_pageSize));
|
| + unittest.expect(
|
| + queryMap["endTime"].first, unittest.equals(arg_endTime));
|
| + unittest.expect(
|
| + queryMap["startTime"].first, unittest.equals(arg_startTime));
|
| + unittest.expect(
|
| + queryMap["pageToken"].first, unittest.equals(arg_pageToken));
|
| + unittest.expect(core.int.parse(queryMap["pageSize"].first),
|
| + unittest.equals(arg_pageSize));
|
| unittest.expect(queryMap["view"].first, unittest.equals(arg_view));
|
| - unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy));
|
| -
|
| + unittest.expect(
|
| + queryMap["orderBy"].first, unittest.equals(arg_orderBy));
|
|
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildListTracesResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.list(arg_projectId, filter: arg_filter, endTime: arg_endTime, pageToken: arg_pageToken, startTime: arg_startTime, pageSize: arg_pageSize, view: arg_view, orderBy: arg_orderBy).then(unittest.expectAsync1(((api.ListTracesResponse response) {
|
| + res
|
| + .list(arg_projectId,
|
| + filter: arg_filter,
|
| + endTime: arg_endTime,
|
| + startTime: arg_startTime,
|
| + pageToken: arg_pageToken,
|
| + pageSize: arg_pageSize,
|
| + view: arg_view,
|
| + orderBy: arg_orderBy)
|
| + .then(unittest.expectAsync1(((api.ListTracesResponse response) {
|
| checkListTracesResponse(response);
|
| })));
|
| });
|
| -
|
| });
|
| -
|
| -
|
| }
|
| -
|
|
|