Search in sources :

Example 31 with MockHttpService

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

the class NodeGroupsClientTest method startStaticServer.

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

Example 32 with MockHttpService

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

the class NodeTemplatesClientTest method startStaticServer.

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

Example 33 with MockHttpService

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

the class PacketMirroringsClientTest method startStaticServer.

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

Example 34 with MockHttpService

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

the class PublicDelegatedPrefixesClientTest method startStaticServer.

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

Example 35 with MockHttpService

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

the class RegionBackendServicesClientTest method startStaticServer.

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