CampaignDraftServiceClient implements BackgroundResource { @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty, Empty> promoteCampaignDraftAsync(String campaignDraft) { PromoteCampaignDraftRequest request = PromoteCampaignDraftRequest.newBuilder().setCampaignDraft(campaignDraft).build(); return promoteCampaignDraftAsync(request); } protected  CampaignDraftServiceClient(CampaignDraftServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignDraftServiceClient(CampaignDraftServiceStub stub); static final CampaignDraftServiceClient create(); static final CampaignDraftServiceClient create(CampaignDraftServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CampaignDraftServiceClient create(CampaignDraftServiceStub stub); final CampaignDraftServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CampaignDraftServiceStub getStub(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationsClient getOperationsClient(); final CampaignDraft getCampaignDraft(CampaignDraftName resourceName); final CampaignDraft getCampaignDraft(String resourceName); final CampaignDraft getCampaignDraft(GetCampaignDraftRequest request); final UnaryCallable<GetCampaignDraftRequest, CampaignDraft> getCampaignDraftCallable(); final MutateCampaignDraftsResponse mutateCampaignDrafts(
      String customerId, List<CampaignDraftOperation> operations); final MutateCampaignDraftsResponse mutateCampaignDrafts(
      MutateCampaignDraftsRequest request); final UnaryCallable<MutateCampaignDraftsRequest, MutateCampaignDraftsResponse> mutateCampaignDraftsCallable(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> promoteCampaignDraftAsync(String campaignDraft); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> promoteCampaignDraftAsync(
      PromoteCampaignDraftRequest request); @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") final OperationCallable<PromoteCampaignDraftRequest, Empty, Empty> promoteCampaignDraftOperationCallable(); final UnaryCallable<PromoteCampaignDraftRequest, Operation> promoteCampaignDraftCallable(); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      CampaignDraftName resourceName); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      String resourceName); final ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(
      ListCampaignDraftAsyncErrorsRequest request); final UnaryCallable<
          ListCampaignDraftAsyncErrorsRequest, ListCampaignDraftAsyncErrorsPagedResponse> listCampaignDraftAsyncErrorsPagedCallable(); final UnaryCallable<
          ListCampaignDraftAsyncErrorsRequest, ListCampaignDraftAsyncErrorsResponse> listCampaignDraftAsyncErrorsCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }
@Test @SuppressWarnings("all") public void promoteCampaignDraftExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCampaignDraftService.addException(exception); try { String campaignDraft = "campaignDraft-1319448142"; client.promoteCampaignDraftAsync(campaignDraft).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } }