diff --git a/playground/frontend/build.gradle b/playground/frontend/build.gradle index 608487d9d3f4..a615684a5841 100644 --- a/playground/frontend/build.gradle +++ b/playground/frontend/build.gradle @@ -22,6 +22,10 @@ apply plugin: 'base' applyDockerNature() def playgroundBackendUrl = project.playgroundBackendUrl +def playgroundBackendJavaRouteUrl = project.playgroundBackendJavaRouteUrl +def playgroundBackendGoRouteUrl = project.playgroundBackendGoRouteUrl +def playgroundBackendPythonRouteUrl = project.playgroundBackendPythonRouteUrl +def playgroundBackendScioRouteUrl = project.playgroundBackendScioRouteUrl def playgroundJobServerProject = "${project.path.replace('-container', '')}" @@ -159,6 +163,14 @@ task("createConfig") { const String kApiClientURL = '${playgroundBackendUrl}'; +const String kApiJavaClientURL = + '${playgroundBackendJavaRouteUrl}'; +const String kApiGoClientURL = + '${playgroundBackendGoRouteUrl}'; +const String kApiPythonClientURL = + '${playgroundBackendPythonRouteUrl}'; +const String kApiScioClientURL = + '${playgroundBackendScioRouteUrl}'; """) } } diff --git a/playground/frontend/gradle.properties b/playground/frontend/gradle.properties index 1d4edc5fe041..0d9e242df829 100644 --- a/playground/frontend/gradle.properties +++ b/playground/frontend/gradle.properties @@ -15,4 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. ################################################################################ -playgroundBackendUrl=https://backend-dot-datatokenization.uc.r.appspot.com \ No newline at end of file +playgroundBackendUrl=https://backend-dot-datatokenization.uc.r.appspot.com +playgroundBackendJavaRouteUrl=https://backend-dot-datatokenization.uc.r.appspot.com/java/ +playgroundBackendGoRouteUrl=https://backend-dot-datatokenization.uc.r.appspot.com/go/ +playgroundBackendPythonRouteUrl=https://backend-dot-datatokenization.uc.r.appspot.com/python/ +playgroundBackendScioRouteUrl=https://backend-dot-datatokenization.uc.r.appspot.com/scio/ diff --git a/playground/frontend/lib/api/iis_workaround_channel.dart b/playground/frontend/lib/api/iis_workaround_channel.dart new file mode 100644 index 000000000000..04b98e549148 --- /dev/null +++ b/playground/frontend/lib/api/iis_workaround_channel.dart @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:grpc/grpc_connection_interface.dart'; +// ignore: implementation_imports +import 'package:grpc/src/client/transport/xhr_transport.dart'; + +class IisWorkaroundChannel extends ClientChannelBase { + final Uri uri; + + IisWorkaroundChannel.xhr(this.uri) : super(); + + @override + ClientConnection createConnection() { + return IisClientConnection(uri); + } +} + +class IisClientConnection extends XhrClientConnection { + IisClientConnection(Uri uri) : super(uri); + + @override + GrpcTransportStream makeRequest(String path, Duration? timeout, + Map metadata, ErrorHandler onError, + {CallOptions? callOptions}) { + print(path); + var pathWithoutFirstSlash = path.substring(1); + print(pathWithoutFirstSlash); + return super.makeRequest(pathWithoutFirstSlash, timeout, metadata, onError, + callOptions: callOptions); + } +} diff --git a/playground/frontend/lib/config.g.dart b/playground/frontend/lib/config.g.dart index 4f68a9f67ff4..d634544a2c3d 100644 --- a/playground/frontend/lib/config.g.dart +++ b/playground/frontend/lib/config.g.dart @@ -18,3 +18,11 @@ const String kApiClientURL = 'https://backend-dot-datatokenization.uc.r.appspot.com'; +const String kApiJavaClientURL = + 'https://backend-dot-datatokenization.uc.r.appspot.com/java/'; +const String kApiGoClientURL = + 'https://backend-dot-datatokenization.uc.r.appspot.com/go/'; +const String kApiPythonClientURL = + 'https://backend-dot-datatokenization.uc.r.appspot.com/python/'; +const String kApiScioClientURL = + 'https://backend-dot-datatokenization.uc.r.appspot.com/scio/'; diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_client/code_client.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_client/code_client.dart index 952fc3102cda..7faa412692a9 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_client/code_client.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_client/code_client.dart @@ -24,11 +24,23 @@ import 'package:playground/modules/editor/repository/code_repository/run_code_re abstract class CodeClient { Future runCode(RunCodeRequestWrapper request); - Future checkStatus(String pipelineUuid); + Future checkStatus( + String pipelineUuid, + RunCodeRequestWrapper request, + ); - Future getCompileOutput(String pipelineUuid); + Future getCompileOutput( + String pipelineUuid, + RunCodeRequestWrapper request, + ); - Future getRunOutput(String pipelineUuid); + Future getRunOutput( + String pipelineUuid, + RunCodeRequestWrapper request, + ); - Future getRunErrorOutput(String pipelineUuid); + Future getRunErrorOutput( + String pipelineUuid, + RunCodeRequestWrapper request, + ); } diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart index 1940e63c2850..175fd836fe88 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart @@ -17,6 +17,7 @@ */ import 'package:grpc/grpc_web.dart'; +import 'package:playground/api/iis_workaround_channel.dart'; import 'package:playground/api/v1/api.pbgrpc.dart' as grpc; import 'package:playground/config.g.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/check_status_response.dart'; @@ -31,26 +32,30 @@ import 'package:playground/modules/sdk/models/sdk.dart'; const kGeneralError = 'Failed to execute code'; class GrpcCodeClient implements CodeClient { - late final GrpcWebClientChannel _channel; - late final grpc.PlaygroundServiceClient _client; - - GrpcCodeClient() { - _channel = GrpcWebClientChannel.xhr( - Uri.parse(kApiClientURL), + grpc.PlaygroundServiceClient createClient(SDK? sdk) { + String apiClientURL = kApiClientURL; + if (sdk != null) { + apiClientURL = sdk.getRoute; + } + IisWorkaroundChannel channel = IisWorkaroundChannel.xhr( + Uri.parse(apiClientURL), ); - _client = grpc.PlaygroundServiceClient(_channel); + return grpc.PlaygroundServiceClient(channel); } @override Future runCode(RunCodeRequestWrapper request) { - return _runSafely(() => _client + return _runSafely(() => createClient(request.sdk) .runCode(_toGrpcRequest(request)) .then((response) => RunCodeResponse(response.pipelineUuid))); } @override - Future checkStatus(String pipelineUuid) { - return _runSafely(() => _client + Future checkStatus( + String pipelineUuid, + RunCodeRequestWrapper request, + ) { + return _runSafely(() => createClient(request.sdk) .checkStatus(grpc.CheckStatusRequest(pipelineUuid: pipelineUuid)) .then( (response) => CheckStatusResponse(_toClientStatus(response.status)), @@ -58,8 +63,11 @@ class GrpcCodeClient implements CodeClient { } @override - Future getCompileOutput(String pipelineUuid) { - return _runSafely(() => _client + Future getCompileOutput( + String pipelineUuid, + RunCodeRequestWrapper request, + ) { + return _runSafely(() => createClient(request.sdk) .getCompileOutput( grpc.GetCompileOutputRequest(pipelineUuid: pipelineUuid), ) @@ -67,15 +75,21 @@ class GrpcCodeClient implements CodeClient { } @override - Future getRunOutput(String pipelineUuid) { - return _runSafely(() => _client + Future getRunOutput( + String pipelineUuid, + RunCodeRequestWrapper request, + ) { + return _runSafely(() => createClient(request.sdk) .getRunOutput(grpc.GetRunOutputRequest(pipelineUuid: pipelineUuid)) .then((response) => OutputResponse(response.output))); } @override - Future getRunErrorOutput(String pipelineUuid) { - return _runSafely(() => _client + Future getRunErrorOutput( + String pipelineUuid, + RunCodeRequestWrapper request, + ) { + return _runSafely(() => createClient(request.sdk) .getRunError(grpc.GetRunErrorRequest(pipelineUuid: pipelineUuid)) .then((response) => OutputResponse(response.output))); } diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart index 4837f5af1185..75c21a343d5b 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart @@ -38,7 +38,7 @@ class CodeRepository { yield RunCodeResult(status: RunCodeStatus.preparation); var runCodeResponse = await _client.runCode(request); final pipelineUuid = runCodeResponse.pipelineUuid; - yield* _checkPipelineExecution(pipelineUuid); + yield* _checkPipelineExecution(pipelineUuid, request); } on RunCodeError catch (error) { yield RunCodeResult( status: RunCodeStatus.unknownError, @@ -48,19 +48,21 @@ class CodeRepository { } Stream _checkPipelineExecution( - String pipelineUuid, { + String pipelineUuid, + RunCodeRequestWrapper request, { RunCodeResult? prevResult, }) async* { - final statusResponse = await _client.checkStatus(pipelineUuid); + final statusResponse = await _client.checkStatus(pipelineUuid, request); final result = await _getPipelineResult( pipelineUuid, statusResponse.status, prevResult, + request, ); yield result; if (!result.isFinished) { await Future.delayed(kPipelineCheckDelay); - yield* _checkPipelineExecution(pipelineUuid, prevResult: result); + yield* _checkPipelineExecution(pipelineUuid, request, prevResult: result); } } @@ -68,27 +70,31 @@ class CodeRepository { String pipelineUuid, RunCodeStatus status, RunCodeResult? prevResult, + RunCodeRequestWrapper request, ) async { final prevOutput = prevResult?.output ?? ''; switch (status) { case RunCodeStatus.compileError: - final compileOutput = await _client.getCompileOutput(pipelineUuid); + final compileOutput = await _client.getCompileOutput( + pipelineUuid, + request, + ); return RunCodeResult(status: status, output: compileOutput.output); case RunCodeStatus.timeout: return RunCodeResult(status: status, errorMessage: kTimeoutErrorText); case RunCodeStatus.runError: - final output = await _client.getRunErrorOutput(pipelineUuid); + final output = await _client.getRunErrorOutput(pipelineUuid, request); return RunCodeResult(status: status, output: output.output); case RunCodeStatus.unknownError: return RunCodeResult(status: status, errorMessage: kUnknownErrorText); case RunCodeStatus.executing: - final output = await _client.getRunOutput(pipelineUuid); + final output = await _client.getRunOutput(pipelineUuid, request); return RunCodeResult( status: status, output: prevOutput + output.output, ); case RunCodeStatus.finished: - final output = await _client.getRunOutput(pipelineUuid); + final output = await _client.getRunOutput(pipelineUuid, request); return RunCodeResult( status: status, output: prevOutput + output.output); default: diff --git a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart index 98baeef19823..3f6f596ddcbe 100644 --- a/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart +++ b/playground/frontend/lib/modules/examples/components/example_list/expansion_panel_item.dart @@ -36,8 +36,10 @@ class ExpansionPanelItem extends StatelessWidget { child: GestureDetector( onTap: () async { if (playgroundState.selectedExample != example) { - final exampleWithInfo = - await exampleState.loadExampleInfo(example); + final exampleWithInfo = await exampleState.loadExampleInfo( + example, + playgroundState.sdk, + ); playgroundState.setExample(exampleWithInfo); } }, diff --git a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart index 031d5da6b215..681e3d6306e5 100644 --- a/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart +++ b/playground/frontend/lib/modules/examples/repositories/example_client/grpc_example_client.dart @@ -17,8 +17,8 @@ */ import 'package:grpc/grpc_web.dart'; +import 'package:playground/api/iis_workaround_channel.dart'; import 'package:playground/api/v1/api.pbgrpc.dart' as grpc; -import 'package:playground/config.g.dart'; import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart'; import 'package:playground/modules/examples/models/category_model.dart'; import 'package:playground/modules/examples/models/example_model.dart'; @@ -30,14 +30,15 @@ import 'package:playground/modules/examples/repositories/models/get_list_of_exam import 'package:playground/modules/sdk/models/sdk.dart'; class GrpcExampleClient implements ExampleClient { - late final GrpcWebClientChannel _channel; - late final grpc.PlaygroundServiceClient _client; - - GrpcExampleClient() { - _channel = GrpcWebClientChannel.xhr( - Uri.parse(kApiClientURL), + grpc.PlaygroundServiceClient createClient(SDK? sdk) { + String apiClientURL = SDK.java.getRoute; + // if (sdk != null) { + // apiClientURL = sdk.getRoute; + // } + IisWorkaroundChannel channel = IisWorkaroundChannel.xhr( + Uri.parse(apiClientURL), ); - _client = grpc.PlaygroundServiceClient(_channel); + return grpc.PlaygroundServiceClient(channel); } @override @@ -45,7 +46,7 @@ class GrpcExampleClient implements ExampleClient { GetListOfExamplesRequestWrapper request, ) { return _runSafely( - () => _client + () => createClient(request.sdk) .getPrecompiledObjects( _getListOfExamplesRequestToGrpcRequest(request)) .then((response) => GetListOfExampleResponse( @@ -56,7 +57,7 @@ class GrpcExampleClient implements ExampleClient { @override Future getExample(GetExampleRequestWrapper request) { return _runSafely( - () => _client + () => createClient(request.sdk) .getPrecompiledObjectCode(_getExampleRequestToGrpcRequest(request)) .then((response) => GetExampleResponse(response.code)), ); @@ -65,7 +66,7 @@ class GrpcExampleClient implements ExampleClient { @override Future getExampleOutput(GetExampleRequestWrapper request) { return _runSafely( - () => _client + () => createClient(request.sdk) .getPrecompiledObjectOutput(_getExampleRequestToGrpcRequest(request)) .then((response) => OutputResponse(response.output)), ); diff --git a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart index 01ff465149d7..d86367c0422d 100644 --- a/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart +++ b/playground/frontend/lib/modules/examples/repositories/models/get_example_request.dart @@ -16,8 +16,11 @@ * limitations under the License. */ +import 'package:playground/modules/sdk/models/sdk.dart'; + class GetExampleRequestWrapper { final String path; + final SDK sdk; - GetExampleRequestWrapper(this.path); + GetExampleRequestWrapper(this.path, this.sdk); } diff --git a/playground/frontend/lib/modules/sdk/models/sdk.dart b/playground/frontend/lib/modules/sdk/models/sdk.dart index 78aa0afaf6f8..392fb07d9883 100644 --- a/playground/frontend/lib/modules/sdk/models/sdk.dart +++ b/playground/frontend/lib/modules/sdk/models/sdk.dart @@ -16,6 +16,8 @@ * limitations under the License. */ +import 'package:playground/config.g.dart'; + enum SDK { java, go, @@ -37,3 +39,20 @@ extension SDKToString on SDK { } } } + +extension SdkToRoute on SDK { + String get getRoute { + switch (this) { + case SDK.java: + return kApiJavaClientURL; + case SDK.go: + return kApiGoClientURL; + case SDK.python: + return kApiPythonClientURL; + case SDK.scio: + return kApiScioClientURL; + default: + return ''; + } + } +} diff --git a/playground/frontend/lib/pages/playground/states/examples_state.dart b/playground/frontend/lib/pages/playground/states/examples_state.dart index 796058808c58..2da5fc86ccaa 100644 --- a/playground/frontend/lib/pages/playground/states/examples_state.dart +++ b/playground/frontend/lib/pages/playground/states/examples_state.dart @@ -40,24 +40,24 @@ class ExampleState with ChangeNotifier { return sdkCategories?[sdk] ?? []; } - Future getExampleOutput(String id) async { + Future getExampleOutput(String id, SDK sdk) async { String output = await _exampleRepository.getExampleOutput( - GetExampleRequestWrapper(id), + GetExampleRequestWrapper(id, sdk), ); return output; } - Future getExampleSource(String id) async { + Future getExampleSource(String id, SDK sdk) async { String source = await _exampleRepository.getExampleSource( - GetExampleRequestWrapper(id), + GetExampleRequestWrapper(id, sdk), ); return source; } - Future loadExampleInfo(ExampleModel example) async { - String source = await getExampleSource(example.path); + Future loadExampleInfo(ExampleModel example, SDK sdk) async { + String source = await getExampleSource(example.path, sdk); example.setSource(source); - final outputs = await getExampleOutput(example.path); + final outputs = await getExampleOutput(example.path, sdk); example.setOutputs(outputs); return example; } @@ -82,7 +82,7 @@ class ExampleState with ChangeNotifier { ExampleModel? defaultExample = sdkCategories![sdk]?.first.examples.first; if (defaultExample != null) { // load source and output async - loadExampleInfo(defaultExample); + loadExampleInfo(defaultExample, sdk); entries.add(MapEntry(sdk, defaultExample)); } } diff --git a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart index b58b8fbee172..2278d158731e 100644 --- a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart +++ b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.dart @@ -61,13 +61,13 @@ void main() { when(client.runCode(kRequestMock)).thenAnswer( (_) async => kRunCodeResponse, ); - when(client.checkStatus(kPipelineUuid)).thenAnswer( + when(client.checkStatus(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kFinishedStatusResponse, ); - when(client.getRunOutput(kPipelineUuid)).thenAnswer( + when(client.getRunOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunOutputResponse, ); - when(client.getCompileOutput(kPipelineUuid)).thenAnswer( + when(client.getCompileOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kCompileOutputResponse, ); @@ -84,7 +84,7 @@ void main() { ]), ); // compile output should not be called - verifyNever(client.getCompileOutput(kPipelineUuid)); + verifyNever(client.getCompileOutput(kPipelineUuid, kRequestMock)); }); test('should return output from compilation if failed', () async { @@ -93,13 +93,13 @@ void main() { when(client.runCode(kRequestMock)).thenAnswer( (_) async => kRunCodeResponse, ); - when(client.checkStatus(kPipelineUuid)).thenAnswer( + when(client.checkStatus(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kCompileErrorStatusResponse, ); - when(client.getCompileOutput(kPipelineUuid)).thenAnswer( + when(client.getCompileOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kCompileOutputResponse, ); - when(client.getRunOutput(kPipelineUuid)).thenAnswer( + when(client.getRunOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunOutputResponse, ); @@ -125,16 +125,16 @@ void main() { when(client.runCode(kRequestMock)).thenAnswer( (_) async => kRunCodeResponse, ); - when(client.checkStatus(kPipelineUuid)).thenAnswer( + when(client.checkStatus(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunErrorStatusResponse, ); - when(client.getCompileOutput(kPipelineUuid)).thenAnswer( + when(client.getCompileOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kCompileOutputResponse, ); - when(client.getRunOutput(kPipelineUuid)).thenAnswer( + when(client.getRunOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunOutputResponse, ); - when(client.getRunErrorOutput(kPipelineUuid)).thenAnswer( + when(client.getRunErrorOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunErrorOutputResponse, ); @@ -165,13 +165,13 @@ void main() { kExecutingStatusResponse, kFinishedStatusResponse ]; - when(client.checkStatus(kPipelineUuid)).thenAnswer( + when(client.checkStatus(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => answers.removeAt(0), ); - when(client.getRunOutput(kPipelineUuid)).thenAnswer( + when(client.getRunOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunOutputResponse, ); - when(client.getRunErrorOutput(kPipelineUuid)).thenAnswer( + when(client.getRunErrorOutput(kPipelineUuid, kRequestMock)).thenAnswer( (_) async => kRunErrorOutputResponse, ); diff --git a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart index c835146f5ad8..0cde4440e7ff 100644 --- a/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart +++ b/playground/frontend/test/modules/editor/repository/code_repository/code_repository_test.mocks.dart @@ -23,15 +23,15 @@ import 'dart:async' as _i6; import 'package:mockito/mockito.dart' as _i1; import 'package:playground/modules/editor/repository/code_repository/code_client/check_status_response.dart' - as _i3; +as _i3; import 'package:playground/modules/editor/repository/code_repository/code_client/code_client.dart' - as _i5; +as _i5; import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart' - as _i4; +as _i4; import 'package:playground/modules/editor/repository/code_repository/code_client/run_code_response.dart' - as _i2; +as _i2; import 'package:playground/modules/editor/repository/code_repository/run_code_request.dart' - as _i7; +as _i7; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters @@ -60,35 +60,41 @@ class MockCodeClient extends _i1.Mock implements _i5.CodeClient { @override _i6.Future<_i2.RunCodeResponse> runCode(_i7.RunCodeRequestWrapper? request) => (super.noSuchMethod(Invocation.method(#runCode, [request]), - returnValue: - Future<_i2.RunCodeResponse>.value(_FakeRunCodeResponse_0())) - as _i6.Future<_i2.RunCodeResponse>); + returnValue: + Future<_i2.RunCodeResponse>.value(_FakeRunCodeResponse_0())) + as _i6.Future<_i2.RunCodeResponse>); + @override - _i6.Future<_i3.CheckStatusResponse> checkStatus(String? pipelineUuid) => - (super.noSuchMethod(Invocation.method(#checkStatus, [pipelineUuid]), - returnValue: Future<_i3.CheckStatusResponse>.value( - _FakeCheckStatusResponse_1())) - as _i6.Future<_i3.CheckStatusResponse>); + _i6.Future<_i3.CheckStatusResponse> checkStatus(String? pipelineUuid, _i7.RunCodeRequestWrapper? request) => + (super.noSuchMethod( + Invocation.method(#checkStatus, [pipelineUuid, request]), + returnValue: Future<_i3.CheckStatusResponse>.value( + _FakeCheckStatusResponse_1())) + as _i6.Future<_i3.CheckStatusResponse>); + @override - _i6.Future<_i4.OutputResponse> getCompileOutput(String? pipelineUuid) => - (super.noSuchMethod(Invocation.method(#getCompileOutput, [pipelineUuid]), - returnValue: - Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) - as _i6.Future<_i4.OutputResponse>); + _i6.Future<_i4.OutputResponse> getCompileOutput(String? pipelineUuid, _i7.RunCodeRequestWrapper? request) => + (super.noSuchMethod( + Invocation.method(#getCompileOutput, [pipelineUuid, request]), + returnValue: + Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) + as _i6.Future<_i4.OutputResponse>); @override - _i6.Future<_i4.OutputResponse> getRunOutput(String? pipelineUuid) => - (super.noSuchMethod(Invocation.method(#getRunOutput, [pipelineUuid]), - returnValue: - Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) - as _i6.Future<_i4.OutputResponse>); + _i6.Future<_i4.OutputResponse> getRunOutput(String? pipelineUuid, _i7.RunCodeRequestWrapper? request) => + (super.noSuchMethod( + Invocation.method(#getRunOutput, [pipelineUuid, request]), + returnValue: + Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) + as _i6.Future<_i4.OutputResponse>); @override - _i6.Future<_i4.OutputResponse> getRunErrorOutput(String? pipelineUuid) => - (super.noSuchMethod(Invocation.method(#getRunErrorOutput, [pipelineUuid]), - returnValue: - Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) - as _i6.Future<_i4.OutputResponse>); + _i6.Future<_i4.OutputResponse> getRunErrorOutput(String? pipelineUuid, _i7.RunCodeRequestWrapper? request) => + (super.noSuchMethod( + Invocation.method(#getRunErrorOutput, [pipelineUuid, request]), + returnValue: + Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) + as _i6.Future<_i4.OutputResponse>); @override String toString() => super.toString(); diff --git a/playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart b/playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart index 204637e57e30..c7a456a39f23 100644 --- a/playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart +++ b/playground/frontend/test/pages/playground/states/example_selector_state_test.mocks.dart @@ -23,17 +23,17 @@ import 'dart:async' as _i6; import 'package:mockito/mockito.dart' as _i1; import 'package:playground/modules/editor/repository/code_repository/code_client/output_response.dart' - as _i4; +as _i4; import 'package:playground/modules/examples/repositories/example_client/example_client.dart' - as _i5; +as _i5; import 'package:playground/modules/examples/repositories/models/get_example_request.dart' - as _i8; +as _i8; import 'package:playground/modules/examples/repositories/models/get_example_response.dart' - as _i3; +as _i3; import 'package:playground/modules/examples/repositories/models/get_list_of_examples_request.dart' - as _i7; +as _i7; import 'package:playground/modules/examples/repositories/models/get_list_of_examples_response.dart' - as _i2; +as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters @@ -61,28 +61,25 @@ class MockExampleClient extends _i1.Mock implements _i5.ExampleClient { } @override - _i6.Future<_i2.GetListOfExampleResponse> getListOfExamples( - _i7.GetListOfExamplesRequestWrapper? request) => + _i6.Future<_i2.GetListOfExampleResponse> getListOfExamples(_i7.GetListOfExamplesRequestWrapper? request) => (super.noSuchMethod(Invocation.method(#getListOfExamples, [request]), - returnValue: Future<_i2.GetListOfExampleResponse>.value( - _FakeGetListOfExampleResponse_0())) - as _i6.Future<_i2.GetListOfExampleResponse>); + returnValue: Future<_i2.GetListOfExampleResponse>.value( + _FakeGetListOfExampleResponse_0())) + as _i6.Future<_i2.GetListOfExampleResponse>); @override - _i6.Future<_i3.GetExampleResponse> getExample( - _i8.GetExampleRequestWrapper? request) => + _i6.Future<_i3.GetExampleResponse> getExample(_i8.GetExampleRequestWrapper? request) => (super.noSuchMethod(Invocation.method(#getExample, [request]), - returnValue: Future<_i3.GetExampleResponse>.value( - _FakeGetExampleResponse_1())) - as _i6.Future<_i3.GetExampleResponse>); + returnValue: Future<_i3.GetExampleResponse>.value( + _FakeGetExampleResponse_1())) + as _i6.Future<_i3.GetExampleResponse>); @override - _i6.Future<_i4.OutputResponse> getExampleOutput( - _i8.GetExampleRequestWrapper? request) => + _i6.Future<_i4.OutputResponse> getExampleOutput(_i8.GetExampleRequestWrapper? request) => (super.noSuchMethod(Invocation.method(#getExampleOutput, [request]), - returnValue: - Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) - as _i6.Future<_i4.OutputResponse>); + returnValue: + Future<_i4.OutputResponse>.value(_FakeOutputResponse_2())) + as _i6.Future<_i4.OutputResponse>); @override String toString() => super.toString();