| Index: generated/googleapis/test/appstate/v1_test.dart
|
| diff --git a/generated/googleapis/test/appstate/v1_test.dart b/generated/googleapis/test/appstate/v1_test.dart
|
| index a2b417202005b6db22fe16bd7cea917628478a9e..2c09978173892f7ccc4a3ba6ca5cb84ec98840a4 100644
|
| --- a/generated/googleapis/test/appstate/v1_test.dart
|
| +++ b/generated/googleapis/test/appstate/v1_test.dart
|
| @@ -1,12 +1,10 @@
|
| library googleapis.appstate.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/appstate/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);
|
| }
|
| @@ -76,14 +75,14 @@ checkGetResponse(api.GetResponse o) {
|
| buildCounterGetResponse--;
|
| }
|
|
|
| -buildUnnamed2515() {
|
| +buildUnnamed2502() {
|
| var o = new core.List<api.GetResponse>();
|
| o.add(buildGetResponse());
|
| o.add(buildGetResponse());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2515(core.List<api.GetResponse> o) {
|
| +checkUnnamed2502(core.List<api.GetResponse> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkGetResponse(o[0]);
|
| checkGetResponse(o[1]);
|
| @@ -94,7 +93,7 @@ buildListResponse() {
|
| var o = new api.ListResponse();
|
| buildCounterListResponse++;
|
| if (buildCounterListResponse < 3) {
|
| - o.items = buildUnnamed2515();
|
| + o.items = buildUnnamed2502();
|
| o.kind = "foo";
|
| o.maximumKeyCount = 42;
|
| }
|
| @@ -105,7 +104,7 @@ buildListResponse() {
|
| checkListResponse(api.ListResponse o) {
|
| buildCounterListResponse++;
|
| if (buildCounterListResponse < 3) {
|
| - checkUnnamed2515(o.items);
|
| + checkUnnamed2502(o.items);
|
| unittest.expect(o.kind, unittest.equals('foo'));
|
| unittest.expect(o.maximumKeyCount, unittest.equals(42));
|
| }
|
| @@ -156,7 +155,6 @@ checkWriteResult(api.WriteResult o) {
|
| buildCounterWriteResult--;
|
| }
|
|
|
| -
|
| main() {
|
| unittest.group("obj-schema-GetResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| @@ -166,7 +164,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-ListResponse", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildListResponse();
|
| @@ -175,7 +172,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-UpdateRequest", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildUpdateRequest();
|
| @@ -184,7 +180,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-WriteResult", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildWriteResult();
|
| @@ -193,10 +188,8 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("resource-StatesResourceApi", () {
|
| unittest.test("method--clear", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.StatesResourceApi res = new api.AppstateApi(mock).states;
|
| var arg_stateKey = 42;
|
| @@ -206,18 +199,23 @@ 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("appstate/v1/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("appstate/v1/"));
|
| pathOffset += 12;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("states/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("states/"));
|
| pathOffset += 7;
|
| index = path.indexOf("/clear", 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_stateKey"));
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("/clear"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 6),
|
| + unittest.equals("/clear"));
|
| pathOffset += 6;
|
|
|
| var query = (req.url).query;
|
| @@ -230,28 +228,31 @@ 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["currentDataVersion"].first, unittest.equals(arg_currentDataVersion));
|
| -
|
| + unittest.expect(queryMap["currentDataVersion"].first,
|
| + unittest.equals(arg_currentDataVersion));
|
|
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildWriteResult());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.clear(arg_stateKey, currentDataVersion: arg_currentDataVersion).then(unittest.expectAsync1(((api.WriteResult response) {
|
| + res
|
| + .clear(arg_stateKey, currentDataVersion: arg_currentDataVersion)
|
| + .then(unittest.expectAsync1(((api.WriteResult response) {
|
| checkWriteResult(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--delete", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.StatesResourceApi res = new api.AppstateApi(mock).states;
|
| var arg_stateKey = 42;
|
| @@ -260,11 +261,14 @@ 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("appstate/v1/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("appstate/v1/"));
|
| pathOffset += 12;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("states/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("states/"));
|
| pathOffset += 7;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -280,16 +284,17 @@ 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 = "";
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| @@ -298,7 +303,6 @@ main() {
|
| });
|
|
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.StatesResourceApi res = new api.AppstateApi(mock).states;
|
| var arg_stateKey = 42;
|
| @@ -307,11 +311,14 @@ 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("appstate/v1/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("appstate/v1/"));
|
| pathOffset += 12;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("states/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("states/"));
|
| pathOffset += 7;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -327,27 +334,29 @@ 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(buildGetResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.get(arg_stateKey).then(unittest.expectAsync1(((api.GetResponse response) {
|
| + res
|
| + .get(arg_stateKey)
|
| + .then(unittest.expectAsync1(((api.GetResponse response) {
|
| checkGetResponse(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--list", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.StatesResourceApi res = new api.AppstateApi(mock).states;
|
| var arg_includeData = true;
|
| @@ -356,11 +365,14 @@ 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("appstate/v1/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("appstate/v1/"));
|
| pathOffset += 12;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equals("states"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 6),
|
| + unittest.equals("states"));
|
| pathOffset += 6;
|
|
|
| var query = (req.url).query;
|
| @@ -373,28 +385,31 @@ 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["includeData"].first, unittest.equals("$arg_includeData"));
|
| -
|
| + unittest.expect(
|
| + queryMap["includeData"].first, unittest.equals("$arg_includeData"));
|
|
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildListResponse());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.list(includeData: arg_includeData).then(unittest.expectAsync1(((api.ListResponse response) {
|
| + res
|
| + .list(includeData: arg_includeData)
|
| + .then(unittest.expectAsync1(((api.ListResponse response) {
|
| checkListResponse(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--update", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.StatesResourceApi res = new api.AppstateApi(mock).states;
|
| var arg_request = buildUpdateRequest();
|
| @@ -408,11 +423,14 @@ 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("appstate/v1/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 12),
|
| + unittest.equals("appstate/v1/"));
|
| pathOffset += 12;
|
| - unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equals("states/"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 7),
|
| + unittest.equals("states/"));
|
| pathOffset += 7;
|
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
|
| pathOffset = path.length;
|
| @@ -428,28 +446,29 @@ 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["currentStateVersion"].first, unittest.equals(arg_currentStateVersion));
|
| -
|
| + unittest.expect(queryMap["currentStateVersion"].first,
|
| + unittest.equals(arg_currentStateVersion));
|
|
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildWriteResult());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.update(arg_request, arg_stateKey, currentStateVersion: arg_currentStateVersion).then(unittest.expectAsync1(((api.WriteResult response) {
|
| + res
|
| + .update(arg_request, arg_stateKey,
|
| + currentStateVersion: arg_currentStateVersion)
|
| + .then(unittest.expectAsync1(((api.WriteResult response) {
|
| checkWriteResult(response);
|
| })));
|
| });
|
| -
|
| });
|
| -
|
| -
|
| }
|
| -
|
|
|