Search in sources :

Example 41 with MockHttpService

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

the class AddressesClientTest method startStaticServer.

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

Example 42 with MockHttpService

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

the class RegionOperationsClientTest method startStaticServer.

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

Example 43 with MockHttpService

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

the class InstanceGroupManagersClientTest method startStaticServer.

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

Example 44 with MockHttpService

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

the class InstanceGroupsClientTest method startStaticServer.

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

Example 45 with MockHttpService

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

the class InstanceTemplatesClientTest method startStaticServer.

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