Search in sources :

Example 16 with BaseException

use of com.microsoft.identity.common.exception.BaseException in project microsoft-authentication-library-common-for-android by AzureAD.

the class IpcStrategyTests method testOperationNotSupportedOnClientSide.

protected void testOperationNotSupportedOnClientSide(@NonNull final BrokerOperationBundle bundle) {
    final IIpcStrategy strategy = getStrategy();
    try {
        strategy.communicateToBroker(bundle);
        Assert.fail("Operation should fail.");
    } catch (BaseException e) {
        Assert.assertTrue(e instanceof BrokerCommunicationException);
        Assert.assertSame(((BrokerCommunicationException) e).getCategory(), OPERATION_NOT_SUPPORTED_ON_CLIENT_SIDE);
        Assert.assertSame(((BrokerCommunicationException) e).getStrategyType(), strategy.getType());
    }
}
Also used : BaseException(com.microsoft.identity.common.exception.BaseException) IIpcStrategy(com.microsoft.identity.common.internal.broker.ipc.IIpcStrategy) BrokerCommunicationException(com.microsoft.identity.common.exception.BrokerCommunicationException)

Aggregations

BaseException (com.microsoft.identity.common.exception.BaseException)16 ClientException (com.microsoft.identity.common.exception.ClientException)6 UserCancelException (com.microsoft.identity.common.exception.UserCancelException)5 IIpcStrategy (com.microsoft.identity.common.internal.broker.ipc.IIpcStrategy)5 BrokerOperationExecutor (com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor)5 BrokerCommunicationException (com.microsoft.identity.common.exception.BrokerCommunicationException)4 Bundle (android.os.Bundle)3 NonNull (androidx.annotation.NonNull)3 BrokerOperationBundle (com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle)3 ArgumentException (com.microsoft.identity.common.exception.ArgumentException)2 ServiceException (com.microsoft.identity.common.exception.ServiceException)2 UiRequiredException (com.microsoft.identity.common.exception.UiRequiredException)2 AcquireTokenResult (com.microsoft.identity.common.internal.result.AcquireTokenResult)2 Context (android.content.Context)1 Intent (android.content.Intent)1 BaseBundle (android.os.BaseBundle)1 IntuneAppProtectionPolicyRequiredException (com.microsoft.identity.common.exception.IntuneAppProtectionPolicyRequiredException)1 BrokerResultFuture (com.microsoft.identity.common.internal.broker.BrokerResultFuture)1 TokenCommand (com.microsoft.identity.common.internal.commands.TokenCommand)1 CommandParameters (com.microsoft.identity.common.internal.commands.parameters.CommandParameters)1