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()));
}
Aggregations