use of com.microsoft.identity.common.internal.providers.microsoft.azureactivedirectory.AzureActiveDirectoryAuthorizationErrorResponse in project microsoft-authentication-library-common-for-android by AzureAD.
the class AzureActiveDirectoryAuthorizationResultFactoryTest method testUrlWithError.
@Test
public void testUrlWithError() {
Intent intent = new Intent();
Bundle bundle = new Bundle();
String responseUrl = REDIRECT_URI + "?error=" + ERROR_MESSAGE + "&error_description=" + ERROR_DESCRIPTION + "&error_codes=" + ERROR_CODES;
bundle.putString(AuthenticationConstants.Browser.RESPONSE_FINAL_URL, responseUrl);
intent.putExtras(bundle);
AzureActiveDirectoryAuthorizationResult result = mAuthorizationResultFactory.createAuthorizationResult(AuthenticationConstants.UIResponse.BROWSER_CODE_COMPLETE, intent, getAADRequest());
assertNotNull(result);
assertNull(result.getAuthorizationResponse());
assertEquals(AuthorizationStatus.FAIL, result.getAuthorizationStatus());
AzureActiveDirectoryAuthorizationErrorResponse errorResponse = result.getAuthorizationErrorResponse();
assertNotNull(errorResponse);
assertEquals(ERROR_MESSAGE, errorResponse.getError());
assertEquals(ERROR_DESCRIPTION, errorResponse.getErrorDescription());
assertEquals(ERROR_CODES, errorResponse.getErrorCodes());
}
Aggregations