use of com.microsoft.graph.core.ClientException in project msgraph-sdk-java by microsoftgraph.
the class DefaultExecutorsTests method testPerformOnForegroundWithClientException.
@Test
public void testPerformOnForegroundWithClientException() {
final String expectedExceptionMessage = "client exception message";
final String expectedLogMessage = "Starting foreground task, current active count:0, with exception com.microsoft.graph.core.ClientException: client exception message";
final ExecutorTestCallback<String> callback = new ExecutorTestCallback<>();
defaultExecutors.performOnForeground(new ClientException(expectedExceptionMessage, null), callback);
callback.waitForCompletion();
assertFalse(callback._successCalled.get());
assertTrue(callback._failureCalled.get());
assertEquals(expectedExceptionMessage, callback._exceptionResult.get().getMessage());
assertEquals(1, mLogger.getLogMessages().size());
assertTrue(mLogger.hasMessage(expectedLogMessage));
}
Aggregations