Search in sources :

Example 6 with IGraphServiceClient

use of com.microsoft.graph.models.extensions.IGraphServiceClient in project msgraph-sdk-java by microsoftgraph.

the class GraphServiceClientTest method testOverrideOfDefaultAuthenticationProvider.

@Test
public void testOverrideOfDefaultAuthenticationProvider() {
    IAuthenticationProvider ap = new IAuthenticationProvider() {

        @Override
        public void authenticateRequest(IHttpRequest request) {
        // do nothing
        }
    };
    IGraphServiceClient client = // 
    GraphServiceClient.builder().authenticationProvider(// 
    ap).buildClient();
    assertEquals(ap, client.getAuthenticationProvider());
    assertNotNull(client.getExecutors());
    assertNotNull(client.getHttpProvider());
    assertNotNull(client.getLogger());
    assertNotNull(client.getSerializer());
    assertEquals(ap, ((DefaultHttpProvider) client.getHttpProvider()).getAuthenticationProvider());
}
Also used : IHttpRequest(com.microsoft.graph.http.IHttpRequest) IAuthenticationProvider(com.microsoft.graph.authentication.IAuthenticationProvider) IGraphServiceClient(com.microsoft.graph.models.extensions.IGraphServiceClient) Test(org.junit.Test)

Aggregations

IGraphServiceClient (com.microsoft.graph.models.extensions.IGraphServiceClient)6 Test (org.junit.Test)6 IAuthenticationProvider (com.microsoft.graph.authentication.IAuthenticationProvider)2 ICallback (com.microsoft.graph.concurrency.ICallback)2 IHttpRequest (com.microsoft.graph.http.IHttpRequest)2 IExecutors (com.microsoft.graph.concurrency.IExecutors)1 IProgressCallback (com.microsoft.graph.concurrency.IProgressCallback)1 ClientException (com.microsoft.graph.core.ClientException)1 DefaultClientConfig (com.microsoft.graph.core.DefaultClientConfig)1 IHttpProvider (com.microsoft.graph.http.IHttpProvider)1 IStatefulResponseHandler (com.microsoft.graph.http.IStatefulResponseHandler)1 ILogger (com.microsoft.graph.logger.ILogger)1 ISerializer (com.microsoft.graph.serializer.ISerializer)1 Map (java.util.Map)1