use of com.google.cloudbuild.v1.DeleteWorkerPoolRequest in project java-cloudbuild by googleapis.
the class CloudBuildClientTest method deleteWorkerPoolTest2.
@Test
public void deleteWorkerPoolTest2() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
Operation resultOperation = Operation.newBuilder().setName("deleteWorkerPoolTest").setDone(true).setResponse(Any.pack(expectedResponse)).build();
mockCloudBuild.addResponse(resultOperation);
String name = "name3373707";
client.deleteWorkerPoolAsync(name).get();
List<AbstractMessage> actualRequests = mockCloudBuild.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteWorkerPoolRequest actualRequest = ((DeleteWorkerPoolRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloudbuild.v1.DeleteWorkerPoolRequest in project java-cloudbuild by googleapis.
the class CloudBuildClientTest method deleteWorkerPoolTest.
@Test
public void deleteWorkerPoolTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
Operation resultOperation = Operation.newBuilder().setName("deleteWorkerPoolTest").setDone(true).setResponse(Any.pack(expectedResponse)).build();
mockCloudBuild.addResponse(resultOperation);
WorkerPoolName name = WorkerPoolName.of("[PROJECT]", "[LOCATION]", "[WORKER_POOL]");
client.deleteWorkerPoolAsync(name).get();
List<AbstractMessage> actualRequests = mockCloudBuild.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteWorkerPoolRequest actualRequest = ((DeleteWorkerPoolRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations