We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for the package!
I'm trying to test an API that uses the fresh_dio passing a HttpClientAdapter Mock as a dio.httpClientAdapter.
I can make some tests pass. Like this one:
`final httpPostResponse = ResponseBody.fromString( responseData, 200, headers: { Headers.contentTypeHeader: [Headers.jsonContentType], }, );
when( () => mockDioAdapter.fetch( any( that: isA<RequestOptions>().having( (options) => options.method, 'POST method', equals('POST'), ), ), any(), any(), ), ).thenAnswer((_) async => httpPostResponse); await meuEspacoApiClient.authenticate( username: 'username', password: 'password', ); expect( meuEspacoApiClient.authenticationStatus, emitsAnyOf([AuthenticationStatus.authenticated]), ); verify( () => mockDioAdapter.fetch( any( that: isA<RequestOptions>() .having( (options) => options.method, 'POST method', equals('POST'), ) .having( (options) => options.baseUrl, 'Base URL', equals('http://localhost:8080'), ), ), any(), any(), ), ).called(1);`
But when I return a response with a status code equals to 401, then a refresh function is not called and the following DioException occurs:
DioException [bad response]: The request returned an invalid status code of 401.
If I handle the exception it not trigger the refresh token even.
I'm using this package wrong or missing something?
Please, help me.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Thanks for the package!
I'm trying to test an API that uses the fresh_dio passing a HttpClientAdapter Mock as a dio.httpClientAdapter.
I can make some tests pass. Like this one:
`final httpPostResponse = ResponseBody.fromString(
responseData,
200,
headers: {
Headers.contentTypeHeader: [Headers.jsonContentType],
},
);
But when I return a response with a status code equals to 401, then a refresh function is not called and the following DioException occurs:
DioException [bad response]: The request returned an invalid status code of 401.
If I handle the exception it not trigger the refresh token even.
I'm using this package wrong or missing something?
Please, help me.
The text was updated successfully, but these errors were encountered: