BillingSetupServiceClient implements BackgroundResource { public final BillingSetup getBillingSetup(BillingSetupName resourceName) { GetBillingSetupRequest request = GetBillingSetupRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getBillingSetup(request); } protected  BillingSetupServiceClient(BillingSetupServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  BillingSetupServiceClient(BillingSetupServiceStub stub); static final BillingSetupServiceClient create(); static final BillingSetupServiceClient create(BillingSetupServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final BillingSetupServiceClient create(BillingSetupServiceStub stub); final BillingSetupServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") BillingSetupServiceStub getStub(); final BillingSetup getBillingSetup(BillingSetupName resourceName); final BillingSetup getBillingSetup(String resourceName); final BillingSetup getBillingSetup(GetBillingSetupRequest request); final UnaryCallable<GetBillingSetupRequest, BillingSetup> getBillingSetupCallable(); final MutateBillingSetupResponse mutateBillingSetup(
      String customerId, BillingSetupOperation operation); final MutateBillingSetupResponse mutateBillingSetup(MutateBillingSetupRequest request); final UnaryCallable<MutateBillingSetupRequest, MutateBillingSetupResponse> mutateBillingSetupCallable(); @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 getBillingSetupTest() { com.google.ads.googleads.v5.services.BillingSetupName resourceName2 = com.google.ads.googleads.v5.services.BillingSetupName.of("[CUSTOMER]", "[BILLING_SETUP]"); BillingSetup expectedResponse = BillingSetup.newBuilder().setResourceName(resourceName2.toString()).build(); mockBillingSetupService.addResponse(expectedResponse); BillingSetupName resourceName = BillingSetupName.of("[CUSTOMER]", "[BILLING_SETUP]"); BillingSetup actualResponse = client.getBillingSetup(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockBillingSetupService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetBillingSetupRequest actualRequest = (GetBillingSetupRequest) actualRequests.get(0); Assert.assertEquals(resourceName, BillingSetupName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getBillingSetupExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockBillingSetupService.addException(exception); try { BillingSetupName resourceName = BillingSetupName.of("[CUSTOMER]", "[BILLING_SETUP]"); client.getBillingSetup(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }