Search in sources :

Example 21 with MockHttpService

use of com.google.api.gax.httpjson.testing.MockHttpService in project java-compute by googleapis.

the class GlobalForwardingRulesClientTest method startStaticServer.

@BeforeClass
public static void startStaticServer() throws IOException {
    mockService = new MockHttpService(HttpJsonGlobalForwardingRulesStub.getMethodDescriptors(), GlobalForwardingRulesSettings.getDefaultEndpoint());
    GlobalForwardingRulesSettings settings = GlobalForwardingRulesSettings.newBuilder().setTransportChannelProvider(GlobalForwardingRulesSettings.defaultHttpJsonTransportProviderBuilder().setHttpTransport(mockService).build()).setCredentialsProvider(NoCredentialsProvider.create()).build();
    client = GlobalForwardingRulesClient.create(settings);
}
Also used : MockHttpService(com.google.api.gax.httpjson.testing.MockHttpService) BeforeClass(org.junit.BeforeClass)

Example 22 with MockHttpService

use of com.google.api.gax.httpjson.testing.MockHttpService in project java-compute by googleapis.

the class GlobalNetworkEndpointGroupsClientTest method startStaticServer.

@BeforeClass
public static void startStaticServer() throws IOException {
    mockService = new MockHttpService(HttpJsonGlobalNetworkEndpointGroupsStub.getMethodDescriptors(), GlobalNetworkEndpointGroupsSettings.getDefaultEndpoint());
    GlobalNetworkEndpointGroupsSettings settings = GlobalNetworkEndpointGroupsSettings.newBuilder().setTransportChannelProvider(GlobalNetworkEndpointGroupsSettings.defaultHttpJsonTransportProviderBuilder().setHttpTransport(mockService).build()).setCredentialsProvider(NoCredentialsProvider.create()).build();
    client = GlobalNetworkEndpointGroupsClient.create(settings);
}
Also used : MockHttpService(com.google.api.gax.httpjson.testing.MockHttpService) BeforeClass(org.junit.BeforeClass)

Example 23 with MockHttpService

use of com.google.api.gax.httpjson.testing.MockHttpService in project java-compute by googleapis.

the class GlobalOperationsClientTest method startStaticServer.

@BeforeClass
public static void startStaticServer() throws IOException {
    mockService = new MockHttpService(HttpJsonGlobalOperationsStub.getMethodDescriptors(), GlobalOperationsSettings.getDefaultEndpoint());
    GlobalOperationsSettings settings = GlobalOperationsSettings.newBuilder().setTransportChannelProvider(GlobalOperationsSettings.defaultHttpJsonTransportProviderBuilder().setHttpTransport(mockService).build()).setCredentialsProvider(NoCredentialsProvider.create()).build();
    client = GlobalOperationsClient.create(settings);
}
Also used : MockHttpService(com.google.api.gax.httpjson.testing.MockHttpService) BeforeClass(org.junit.BeforeClass)

Example 24 with MockHttpService

use of com.google.api.gax.httpjson.testing.MockHttpService in project java-compute by googleapis.

the class HealthChecksClientTest method startStaticServer.

@BeforeClass
public static void startStaticServer() throws IOException {
    mockService = new MockHttpService(HttpJsonHealthChecksStub.getMethodDescriptors(), HealthChecksSettings.getDefaultEndpoint());
    HealthChecksSettings settings = HealthChecksSettings.newBuilder().setTransportChannelProvider(HealthChecksSettings.defaultHttpJsonTransportProviderBuilder().setHttpTransport(mockService).build()).setCredentialsProvider(NoCredentialsProvider.create()).build();
    client = HealthChecksClient.create(settings);
}
Also used : MockHttpService(com.google.api.gax.httpjson.testing.MockHttpService) BeforeClass(org.junit.BeforeClass)

Example 25 with MockHttpService

use of com.google.api.gax.httpjson.testing.MockHttpService in project java-compute by googleapis.

the class ImagesClientTest method startStaticServer.

@BeforeClass
public static void startStaticServer() throws IOException {
    mockService = new MockHttpService(HttpJsonImagesStub.getMethodDescriptors(), ImagesSettings.getDefaultEndpoint());
    ImagesSettings settings = ImagesSettings.newBuilder().setTransportChannelProvider(ImagesSettings.defaultHttpJsonTransportProviderBuilder().setHttpTransport(mockService).build()).setCredentialsProvider(NoCredentialsProvider.create()).build();
    client = ImagesClient.create(settings);
}
Also used : MockHttpService(com.google.api.gax.httpjson.testing.MockHttpService) BeforeClass(org.junit.BeforeClass)

Aggregations

MockHttpService (com.google.api.gax.httpjson.testing.MockHttpService)84 BeforeClass (org.junit.BeforeClass)84