Search in sources :

Example 1 with MockHttpService

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

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

the class SslPoliciesClientTest method startStaticServer.

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

Example 3 with MockHttpService

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

the class SubnetworksClientTest method startStaticServer.

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

Example 4 with MockHttpService

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

the class TargetGrpcProxiesClientTest method startStaticServer.

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

Example 5 with MockHttpService

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

the class TargetInstancesClientTest method startStaticServer.

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