Search in sources :

Example 1 with MockGoogleProtoClient

use of com.google.api.client.googleapis.testing.services.protobuf.MockGoogleProtoClient in project google-api-java-client by google.

the class CommonGoogleProtoClientRequestInitializerTest method testInitialize.

public void testInitialize() throws Exception {
    CommonGoogleProtoClientRequestInitializer key = new CommonGoogleProtoClientRequestInitializer("foo");
    MockGoogleProtoClient client = new MockGoogleProtoClient.Builder(new MockHttpTransport(), HttpTesting.SIMPLE_URL, "test/", null).setApplicationName("Test Application").build();
    MyRequest request = new MyRequest(client, "GET", "", null, String.class);
    assertNull(request.key);
    key.initialize(request);
    assertEquals("foo", request.key);
}
Also used : MockHttpTransport(com.google.api.client.testing.http.MockHttpTransport) MockGoogleProtoClient(com.google.api.client.googleapis.testing.services.protobuf.MockGoogleProtoClient)

Aggregations

MockGoogleProtoClient (com.google.api.client.googleapis.testing.services.protobuf.MockGoogleProtoClient)1 MockHttpTransport (com.google.api.client.testing.http.MockHttpTransport)1