use of com.microsoft.graph.concurrency.IExecutors in project msgraph-sdk-java by microsoftgraph.
the class GraphServiceClientTest method testOverrideOfDefaultExecutors.
@Test
public void testOverrideOfDefaultExecutors() {
IExecutors ex = new IExecutors() {
@Override
public void performOnBackground(Runnable runnable) {
// do nothing
}
@Override
public <Result> void performOnForeground(Result result, ICallback<Result> callback) {
// do nothing
}
@Override
public <Result> void performOnForeground(int progress, int progressMax, IProgressCallback<Result> callback) {
// do nothing
}
@Override
public <Result> void performOnForeground(ClientException exception, ICallback<Result> callback) {
// do nothing
}
};
IGraphServiceClient client = //
GraphServiceClient.builder().authenticationProvider(//
auth).executors(//
ex).buildClient();
assertEquals(ex, client.getExecutors());
assertEquals(auth, client.getAuthenticationProvider());
assertNotNull(client.getHttpProvider());
assertNotNull(client.getLogger());
assertNotNull(client.getSerializer());
assertEquals(ex, ((DefaultHttpProvider) client.getHttpProvider()).getExecutors());
}
Aggregations