use of com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrokerOperationExecutorTests method expectCorruptedBundleException.
private void expectCorruptedBundleException(final List<IIpcStrategy> strategyList) {
try {
final BrokerOperationExecutor executor = new BrokerOperationExecutor(strategyList);
executor.execute(getMockParameter(), getBrokerOperation());
Assert.fail("Failure is expected.");
} catch (final BaseException e) {
Assert.assertTrue(e instanceof ClientException);
Assert.assertEquals(e.getErrorCode(), CORRUPTED_BUNDLE_ERROR_CODE);
}
}
use of com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrokerOperationExecutorTests method expectServiceException.
private void expectServiceException(final List<IIpcStrategy> strategyList) {
try {
final BrokerOperationExecutor executor = new BrokerOperationExecutor(strategyList);
executor.execute(getMockParameter(), getBrokerOperation());
Assert.fail("Failure is expected.");
} catch (final BaseException e) {
Assert.assertTrue(e instanceof ServiceException);
Assert.assertEquals(e.getErrorCode(), SERVICE_EXCEPTION_BUNDLE_ERROR_CODE);
}
}
use of com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrokerOperationExecutorTests method expectValidResult.
private void expectValidResult(final List<IIpcStrategy> strategyList) {
try {
final BrokerOperationExecutor executor = new BrokerOperationExecutor(strategyList);
Assert.assertTrue(executor.execute(getMockParameter(), getBrokerOperation()));
} catch (final BaseException e) {
Assert.fail("Unexpected exception.");
}
}
use of com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrokerOperationExecutorTests method expectUserCancelledException.
private void expectUserCancelledException(final List<IIpcStrategy> strategyList) {
try {
final BrokerOperationExecutor executor = new BrokerOperationExecutor(strategyList);
executor.execute(getMockParameter(), getBrokerOperation());
Assert.fail("Failure is expected.");
} catch (final BaseException e) {
Assert.assertTrue(e instanceof UserCancelException);
}
}
use of com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrokerOperationExecutorTests method expectBindFailureException.
private void expectBindFailureException(final List<IIpcStrategy> strategyList) {
try {
final BrokerOperationExecutor executor = new BrokerOperationExecutor(strategyList);
executor.execute(getMockParameter(), getBrokerOperation());
Assert.fail("Failure is expected.");
} catch (final BaseException e) {
Assert.assertTrue(e instanceof ClientException);
Assert.assertEquals(e.getErrorCode(), ErrorStrings.BROKER_BIND_SERVICE_FAILED);
Assert.assertEquals(e.getSuppressed().length, strategyList.size());
}
}
Aggregations