Search in sources :

Example 66 with MockHttpService

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

the class MachineTypesClientTest method startStaticServer.

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

Example 67 with MockHttpService

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

the class NetworkEndpointGroupsClientTest method startStaticServer.

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

Example 68 with MockHttpService

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

the class NetworksClientTest method startStaticServer.

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

Example 69 with MockHttpService

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

the class GlobalOrganizationOperationsClientTest method startStaticServer.

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

Example 70 with MockHttpService

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

the class GlobalPublicDelegatedPrefixesClientTest method startStaticServer.

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