Search in sources :

Example 81 with MockHttpService

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

the class TargetTcpProxiesClientTest method startStaticServer.

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

Example 82 with MockHttpService

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

the class TargetVpnGatewaysClientTest method startStaticServer.

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

Example 83 with MockHttpService

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

the class VpnGatewaysClientTest method startStaticServer.

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

Example 84 with MockHttpService

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

the class OperationsClientTest method startStaticServer.

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