Search in sources :

Example 26 with MockHttpService

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

the class RegionInstancesClientTest method startStaticServer.

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

Example 27 with MockHttpService

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

the class RegionNetworkEndpointGroupsClientTest method startStaticServer.

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

Example 28 with MockHttpService

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

the class RegionNotificationEndpointsClientTest method startStaticServer.

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

Example 29 with MockHttpService

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

the class RegionTargetHttpsProxiesClientTest method startStaticServer.

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

Example 30 with MockHttpService

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

the class RegionsClientTest method startStaticServer.

@BeforeClass
public static void startStaticServer() throws IOException {
    mockService = new MockHttpService(HttpJsonRegionsStub.getMethodDescriptors(), RegionsSettings.getDefaultEndpoint());
    RegionsSettings settings = RegionsSettings.newBuilder().setTransportChannelProvider(RegionsSettings.defaultHttpJsonTransportProviderBuilder().setHttpTransport(mockService).build()).setCredentialsProvider(NoCredentialsProvider.create()).build();
    client = RegionsClient.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