| import 'package:googleapis/bigquery/v2.dart'; |
| |
| import '../bigquery.dart'; |
| import 'mocks.dart'; |
| |
| const String revertRequestRecordResponse = ''' |
| { |
| "jobComplete": true, |
| "rows": [ |
| { "f": [ |
| { "v": "flutter"}, |
| { "v": "cocoon" }, |
| { "v": "ricardoamador" }, |
| { "v": "1024" }, |
| { "v": "123f124" }, |
| { "v": "123456789" }, |
| { "v": "123456999" }, |
| { "v": "ricardoamador" }, |
| { "v": "2048" }, |
| { "v": "ce345dc" }, |
| { "v": "234567890" }, |
| { "v": "234567999" }, |
| { "v": "ricardoamador" }, |
| { "v": "11304" }, |
| { "v": "1640979000000" }, |
| { "v": "0" }, |
| { "v": "" } |
| ] |
| } |
| ] |
| } |
| '''; |
| |
| const String pullRequestRecordResponse = ''' |
| { |
| "jobComplete": true, |
| "rows": [ |
| { "f": [ |
| { "v": "123456789"}, |
| { "v": "234567890" }, |
| { "v": "flutter" }, |
| { "v": "cocoon" }, |
| { "v": "ricardoamador" }, |
| { "v": "345" }, |
| { "v": "ade456" }, |
| { "v": "merge" } |
| ] |
| } |
| ] |
| } |
| '''; |
| |
| const String successResponseNoRowsAffected = ''' |
| { |
| "jobComplete": true |
| } |
| '''; |
| |
| const String insertDeleteUpdateSuccessResponse = ''' |
| { |
| "jobComplete": true, |
| "numDmlAffectedRows": "1" |
| } |
| '''; |
| |
| const String insertDeleteUpdateSuccessTooManyRows = ''' |
| { |
| "jobComplete": true, |
| "numDmlAffectedRows": "2" |
| } |
| '''; |
| |
| const String selectPullRequestTooManyRowsResponse = ''' |
| { |
| "jobComplete": true, |
| "numDmlAffectedRows": "2", |
| "rows": [ |
| { "f": [ |
| { "v": "123456789"}, |
| { "v": "234567890" }, |
| { "v": "flutter" }, |
| { "v": "cocoon" }, |
| { "v": "ricardoamador" }, |
| { "v": "345" }, |
| { "v": "ade456" }, |
| { "v": "merge" } |
| ] |
| }, |
| { "f": [ |
| { "v": "123456789"}, |
| { "v": "234567890" }, |
| { "v": "flutter" }, |
| { "v": "cocoon" }, |
| { "v": "ricardoamador" }, |
| { "v": "345" }, |
| { "v": "ade456" }, |
| { "v": "merge" } |
| ] |
| } |
| ] |
| } |
| '''; |
| |
| const String selectRevertRequestTooManyRowsResponse = ''' |
| { |
| "jobComplete": true, |
| "numDmlAffectedRows": "2", |
| "rows": [ |
| { "f": [ |
| { "v": "flutter"}, |
| { "v": "cocoon" }, |
| { "v": "ricardoamador" }, |
| { "v": "1024" }, |
| { "v": "123f124" }, |
| { "v": "123456789" }, |
| { "v": "123456999" }, |
| { "v": "ricardoamador" }, |
| { "v": "2048" }, |
| { "v": "ce345dc" }, |
| { "v": "234567890" }, |
| { "v": "234567999" } |
| ] |
| }, |
| { "f": [ |
| { "v": "flutter"}, |
| { "v": "cocoon" }, |
| { "v": "ricardoamador" }, |
| { "v": "1024" }, |
| { "v": "123f124" }, |
| { "v": "123456789" }, |
| { "v": "123456999" }, |
| { "v": "ricardoamador" }, |
| { "v": "2048" }, |
| { "v": "ce345dc" }, |
| { "v": "234567890" }, |
| { "v": "234567999" } |
| ] |
| } |
| ] |
| } |
| '''; |
| |
| const String errorResponse = ''' |
| { |
| "jobComplete": false |
| } |
| '''; |
| |
| const String selectReviewRequestRecordsResponse = ''' |
| { |
| "jobComplete": true, |
| "numDmlAffectedRows": "2", |
| "rows": [ |
| { "f": [ |
| { "v": "Keyonghan" }, |
| { "v": "2048" }, |
| { "v": "234567890" }, |
| { "v": "0" }, |
| { "v": "" } |
| ] |
| }, |
| { "f": [ |
| { "v": "caseyhillers" }, |
| { "v": "2049" }, |
| { "v": "234567890" }, |
| { "v": "0" }, |
| { "v": "" } |
| ] |
| } |
| ] |
| } |
| '''; |
| |
| const String expectedProjectId = 'flutter-dashboard'; |
| |
| class FakeBigqueryService extends BigqueryService { |
| FakeBigqueryService(this.jobsResource) : super(MockAccessClientProvider()); |
| |
| JobsResource jobsResource; |
| |
| @override |
| Future<JobsResource> defaultJobs() async { |
| return jobsResource; |
| } |
| } |