use of com.microsoft.identity.common.internal.commands.CommandCallback in project microsoft-authentication-library-common-for-android by AzureAD.
the class CommandDispatcherTest method testSubmitSilentWithTerminalException.
@Test
public void testSubmitSilentWithTerminalException() {
final String errorCode = "anError";
final CountDownLatch testLatch = new CountDownLatch(1);
CommandDispatcher.submitSilent(new CommandThrowingIErrorInformationException(getEmptyTestParams(), new CommandCallback<String, Exception>() {
@Override
public void onCancel() {
testLatch.countDown();
Assert.fail();
}
@Override
public void onError(Exception error) {
Assert.assertEquals(ClientException.class, error.getClass());
Assert.assertEquals(errorCode, ((ClientException) error).getErrorCode());
testLatch.countDown();
}
@Override
public void onTaskCompleted(String s) {
testLatch.countDown();
Assert.fail();
}
}, errorCode));
}
use of com.microsoft.identity.common.internal.commands.CommandCallback in project microsoft-authentication-library-common-for-android by AzureAD.
the class CommandDispatcherTest method testSubmitSilentWithException.
@Test
public void testSubmitSilentWithException() {
final CountDownLatch testLatch = new CountDownLatch(1);
CommandDispatcher.submitSilent(new ExceptionCommand(getEmptyTestParams(), new CommandCallback<String, Exception>() {
@Override
public void onCancel() {
testLatch.countDown();
Assert.fail();
}
@Override
public void onError(Exception error) {
testLatch.countDown();
}
@Override
public void onTaskCompleted(String s) {
testLatch.countDown();
Assert.fail();
}
}));
}
Aggregations