TF-2461 Write unit test for login AuthorizationInterceptors

Signed-off-by: dab246 <tdvu@linagora.com>

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2024-01-26 08:36:49 +07:00
committed by Dat H. Pham
parent d450d30949
commit d98fcf72e0
6 changed files with 280 additions and 3 deletions
@@ -77,7 +77,7 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
case AuthenticationType.none:
break;
}
log('AuthorizationInterceptors::onRequest(): URL = ${options.uri} | HEADER = ${options.headers} | DATA = ${options.data}');
log('AuthorizationInterceptors::onRequest(): URL = ${options.uri} | HEADER = ${options.headers} | DATA = ${options.data} | METHOD = ${options.method}');
super.onRequest(options, handler);
}
@@ -89,7 +89,7 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
@override
void onError(DioError err, ErrorInterceptorHandler handler) async {
logError('AuthorizationInterceptors::onError(): DIO_ERROR = $err');
logError('AuthorizationInterceptors::onError(): DIO_ERROR = $err | METHOD = ${err.requestOptions.method}');
try {
if (validateToRefreshToken(responseStatusCode: err.response?.statusCode)) {
log('AuthorizationInterceptors::onError:_validateToRefreshToken');