withToken method
a copy of this client that sends Authorization: Bearer <token>.
TestResponse res = await client.withToken(token).get('/api/me');
Implementation
DoxTestClient withToken(String token) {
return withHeaders(<String, String>{
HttpHeaders.authorizationHeader: 'Bearer $token',
});
}