| Index: generated/googleapis/test/oauth2/v2_test.dart
|
| diff --git a/generated/googleapis/test/oauth2/v2_test.dart b/generated/googleapis/test/oauth2/v2_test.dart
|
| index b742b10cc57fb93db623d4e7bce94bd017a57403..698853c327451b4350d694e0b5dbf43f499d445c 100644
|
| --- a/generated/googleapis/test/oauth2/v2_test.dart
|
| +++ b/generated/googleapis/test/oauth2/v2_test.dart
|
| @@ -1,12 +1,10 @@
|
| library googleapis.oauth2.v2.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/oauth2/v2.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);
|
| }
|
| @@ -80,14 +79,14 @@ checkJwkKeys(api.JwkKeys o) {
|
| buildCounterJwkKeys--;
|
| }
|
|
|
| -buildUnnamed2516() {
|
| +buildUnnamed2503() {
|
| var o = new core.List<api.JwkKeys>();
|
| o.add(buildJwkKeys());
|
| o.add(buildJwkKeys());
|
| return o;
|
| }
|
|
|
| -checkUnnamed2516(core.List<api.JwkKeys> o) {
|
| +checkUnnamed2503(core.List<api.JwkKeys> o) {
|
| unittest.expect(o, unittest.hasLength(2));
|
| checkJwkKeys(o[0]);
|
| checkJwkKeys(o[1]);
|
| @@ -98,7 +97,7 @@ buildJwk() {
|
| var o = new api.Jwk();
|
| buildCounterJwk++;
|
| if (buildCounterJwk < 3) {
|
| - o.keys = buildUnnamed2516();
|
| + o.keys = buildUnnamed2503();
|
| }
|
| buildCounterJwk--;
|
| return o;
|
| @@ -107,7 +106,7 @@ buildJwk() {
|
| checkJwk(api.Jwk o) {
|
| buildCounterJwk++;
|
| if (buildCounterJwk < 3) {
|
| - checkUnnamed2516(o.keys);
|
| + checkUnnamed2503(o.keys);
|
| }
|
| buildCounterJwk--;
|
| }
|
| @@ -186,7 +185,6 @@ checkUserinfoplus(api.Userinfoplus o) {
|
| buildCounterUserinfoplus--;
|
| }
|
|
|
| -
|
| main() {
|
| unittest.group("obj-schema-JwkKeys", () {
|
| unittest.test("to-json--from-json", () {
|
| @@ -196,7 +194,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Jwk", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildJwk();
|
| @@ -205,7 +202,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Tokeninfo", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildTokeninfo();
|
| @@ -214,7 +210,6 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("obj-schema-Userinfoplus", () {
|
| unittest.test("to-json--from-json", () {
|
| var o = buildUserinfoplus();
|
| @@ -223,10 +218,8 @@ main() {
|
| });
|
| });
|
|
|
| -
|
| unittest.group("resource-Oauth2Api", () {
|
| unittest.test("method--getCertForOpenIdConnect", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.Oauth2Api res = new api.Oauth2Api(mock);
|
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
|
| @@ -234,9 +227,11 @@ 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 + 15), unittest.equals("oauth2/v2/certs"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 15),
|
| + unittest.equals("oauth2/v2/certs"));
|
| pathOffset += 15;
|
|
|
| var query = (req.url).query;
|
| @@ -249,27 +244,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(buildJwk());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.getCertForOpenIdConnect().then(unittest.expectAsync1(((api.Jwk response) {
|
| + res
|
| + .getCertForOpenIdConnect()
|
| + .then(unittest.expectAsync1(((api.Jwk response) {
|
| checkJwk(response);
|
| })));
|
| });
|
|
|
| unittest.test("method--tokeninfo", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.Oauth2Api res = new api.Oauth2Api(mock);
|
| var arg_accessToken = "foo";
|
| @@ -280,9 +277,11 @@ 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 + 19), unittest.equals("oauth2/v2/tokeninfo"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 19),
|
| + unittest.equals("oauth2/v2/tokeninfo"));
|
| pathOffset += 19;
|
|
|
| var query = (req.url).query;
|
| @@ -295,34 +294,40 @@ 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["access_token"].first, unittest.equals(arg_accessToken));
|
| - unittest.expect(queryMap["id_token"].first, unittest.equals(arg_idToken));
|
| - unittest.expect(queryMap["token_handle"].first, unittest.equals(arg_tokenHandle));
|
| -
|
| + unittest.expect(
|
| + queryMap["access_token"].first, unittest.equals(arg_accessToken));
|
| + unittest.expect(
|
| + queryMap["id_token"].first, unittest.equals(arg_idToken));
|
| + unittest.expect(
|
| + queryMap["token_handle"].first, unittest.equals(arg_tokenHandle));
|
|
|
| var h = {
|
| - "content-type" : "application/json; charset=utf-8",
|
| + "content-type": "application/json; charset=utf-8",
|
| };
|
| var resp = convert.JSON.encode(buildTokeninfo());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| }), true);
|
| - res.tokeninfo(accessToken: arg_accessToken, idToken: arg_idToken, tokenHandle: arg_tokenHandle).then(unittest.expectAsync1(((api.Tokeninfo response) {
|
| + res
|
| + .tokeninfo(
|
| + accessToken: arg_accessToken,
|
| + idToken: arg_idToken,
|
| + tokenHandle: arg_tokenHandle)
|
| + .then(unittest.expectAsync1(((api.Tokeninfo response) {
|
| checkTokeninfo(response);
|
| })));
|
| });
|
| -
|
| });
|
|
|
| -
|
| unittest.group("resource-UserinfoResourceApi", () {
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.UserinfoResourceApi res = new api.Oauth2Api(mock).userinfo;
|
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
|
| @@ -330,9 +335,11 @@ 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 + 18), unittest.equals("oauth2/v2/userinfo"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 18),
|
| + unittest.equals("oauth2/v2/userinfo"));
|
| pathOffset += 18;
|
|
|
| var query = (req.url).query;
|
| @@ -345,16 +352,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 = convert.JSON.encode(buildUserinfoplus());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| @@ -363,13 +371,10 @@ main() {
|
| checkUserinfoplus(response);
|
| })));
|
| });
|
| -
|
| });
|
|
|
| -
|
| unittest.group("resource-UserinfoV2MeResourceApi", () {
|
| unittest.test("method--get", () {
|
| -
|
| var mock = new HttpServerMock();
|
| api.UserinfoV2MeResourceApi res = new api.Oauth2Api(mock).userinfo.v2.me;
|
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
|
| @@ -377,9 +382,11 @@ 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 + 14), unittest.equals("userinfo/v2/me"));
|
| + unittest.expect(path.substring(pathOffset, pathOffset + 14),
|
| + unittest.equals("userinfo/v2/me"));
|
| pathOffset += 14;
|
|
|
| var query = (req.url).query;
|
| @@ -392,16 +399,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 = convert.JSON.encode(buildUserinfoplus());
|
| return new async.Future.value(stringResponse(200, h, resp));
|
| @@ -410,9 +418,5 @@ main() {
|
| checkUserinfoplus(response);
|
| })));
|
| });
|
| -
|
| });
|
| -
|
| -
|
| }
|
| -
|
|
|