@@ -2,7 +2,6 @@ import 'package:checks/checks.dart';
2
2
import 'package:flutter/foundation.dart' ;
3
3
import 'package:flutter_test/flutter_test.dart' ;
4
4
import 'package:http/http.dart' as http;
5
- import 'package:zulip/api/exception.dart' ;
6
5
import 'package:zulip/model/actions.dart' ;
7
6
import 'package:zulip/model/store.dart' ;
8
7
import 'package:zulip/notifications/receive.dart' ;
@@ -102,13 +101,7 @@ void main() {
102
101
check (testBinding.globalStore).accountIds.single.equals (eg.selfAccount.id);
103
102
const unregisterDelay = Duration (seconds: 5 );
104
103
assert (unregisterDelay > TestGlobalStore .removeAccountDuration);
105
- final exception = ZulipApiException (
106
- httpStatus: 401 ,
107
- code: 'UNAUTHORIZED' ,
108
- data: {},
109
- routeName: 'removeEtcEtcToken' ,
110
- message: 'Invalid API key' ,
111
- );
104
+ final exception = eg.apiExceptionUnauthorized (routeName: 'removeEtcEtcToken' );
112
105
final newConnection = separateConnection ()
113
106
..prepare (delay: unregisterDelay, exception: exception);
114
107
@@ -170,14 +163,9 @@ void main() {
170
163
test ('connection closed if request errors' , () => awaitFakeAsync ((async ) async {
171
164
await prepare (ackedPushToken: '123' );
172
165
166
+ final exception = eg.apiExceptionUnauthorized (routeName: 'removeEtcEtcToken' );
173
167
final newConnection = separateConnection ()
174
- ..prepare (exception: ZulipApiException (
175
- httpStatus: 401 ,
176
- code: 'UNAUTHORIZED' ,
177
- data: {},
178
- routeName: 'removeEtcEtcToken' ,
179
- message: 'Invalid API key' ,
180
- ));
168
+ ..prepare (exception: exception);
181
169
final future = unregisterToken (testBinding.globalStore, eg.selfAccount.id);
182
170
async .elapse (Duration .zero);
183
171
await future;
0 commit comments