@@ -102,13 +102,7 @@ void main() {
102
102
check (testBinding.globalStore).accountIds.single.equals (eg.selfAccount.id);
103
103
const unregisterDelay = Duration (seconds: 5 );
104
104
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
- );
105
+ final exception = eg.apiExceptionUnauthorized (routeName: 'removeEtcEtcToken' );
112
106
final newConnection = separateConnection ()
113
107
..prepare (delay: unregisterDelay, exception: exception);
114
108
@@ -170,14 +164,9 @@ void main() {
170
164
test ('connection closed if request errors' , () => awaitFakeAsync ((async ) async {
171
165
await prepare (ackedPushToken: '123' );
172
166
167
+ final exception = eg.apiExceptionUnauthorized (routeName: 'removeEtcEtcToken' );
173
168
final newConnection = separateConnection ()
174
- ..prepare (exception: ZulipApiException (
175
- httpStatus: 401 ,
176
- code: 'UNAUTHORIZED' ,
177
- data: {},
178
- routeName: 'removeEtcEtcToken' ,
179
- message: 'Invalid API key' ,
180
- ));
169
+ ..prepare (exception: exception);
181
170
final future = unregisterToken (testBinding.globalStore, eg.selfAccount.id);
182
171
async .elapse (Duration .zero);
183
172
await future;
0 commit comments