Search in sources :

Example 1 with ListLocationsResponse

use of com.google.container.v1beta1.ListLocationsResponse in project java-container by googleapis.

the class ClusterManagerClientTest method listLocationsTest.

@Test
public void listLocationsTest() throws Exception {
    ListLocationsResponse expectedResponse = ListLocationsResponse.newBuilder().addAllLocations(new ArrayList<Location>()).setNextPageToken("nextPageToken-1386094857").build();
    mockClusterManager.addResponse(expectedResponse);
    String parent = "parent-995424086";
    ListLocationsResponse actualResponse = client.listLocations(parent);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0));
    Assert.assertEquals(parent, actualRequest.getParent());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : ListLocationsResponse(com.google.container.v1beta1.ListLocationsResponse) AbstractMessage(com.google.protobuf.AbstractMessage) ListLocationsRequest(com.google.container.v1beta1.ListLocationsRequest) Location(com.google.container.v1beta1.Location) Test(org.junit.Test)

Aggregations

ListLocationsRequest (com.google.container.v1beta1.ListLocationsRequest)1 ListLocationsResponse (com.google.container.v1beta1.ListLocationsResponse)1 Location (com.google.container.v1beta1.Location)1 AbstractMessage (com.google.protobuf.AbstractMessage)1 Test (org.junit.Test)1