Search in sources :

Example 56 with MockHttpService

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

the class DiskTypesClientTest method startStaticServer.

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

Example 57 with MockHttpService

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

the class ForwardingRulesClientTest method startStaticServer.

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

Example 58 with MockHttpService

use of com.google.api.gax.httpjson.testing.MockHttpService in project java-compute 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 59 with MockHttpService

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

the class RegionSslCertificatesClientTest method startStaticServer.

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

Example 60 with MockHttpService

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

the class RegionTargetHttpProxiesClientTest method startStaticServer.

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