Search in sources :

Example 76 with MockHttpService

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

the class SslCertificatesClientTest method startStaticServer.

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

Example 77 with MockHttpService

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

the class TargetHttpProxiesClientTest method startStaticServer.

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

Example 78 with MockHttpService

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

the class TargetHttpsProxiesClientTest method startStaticServer.

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

Example 79 with MockHttpService

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

the class VpnTunnelsClientTest method startStaticServer.

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

Example 80 with MockHttpService

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

the class ZoneOperationsClientTest method startStaticServer.

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