Search in sources :

Example 71 with MockHttpService

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

the class ImageFamilyViewsClientTest method startStaticServer.

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

Example 72 with MockHttpService

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

the class ResourcePoliciesClientTest method startStaticServer.

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

Example 73 with MockHttpService

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

the class AcceleratorTypesClientTest method startStaticServer.

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

Example 74 with MockHttpService

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

the class AutoscalersClientTest method startStaticServer.

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

Example 75 with MockHttpService

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

the class BackendBucketsClientTest method startStaticServer.

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