Executes a request with a Bearer Authorization header to the application under test.
The path
will be appended to the baseURL of this instance. You may omit or include
the leading slash in the path, the result will be the same.
If you do not provide an accessToken
, the value of defaultAccessToken
will be used.
Source
TestRequest authenticatedRequest(String path, {String accessToken: null}) { accessToken ??= defaultAccessToken; var req = request(path)..bearerAuthorization = accessToken; return req; }