ProductBiddingCategoryConstantServiceClient implements BackgroundResource { public final ProductBiddingCategoryConstant getProductBiddingCategoryConstant( ProductBiddingCategoryConstantName resourceName) { GetProductBiddingCategoryConstantRequest request = GetProductBiddingCategoryConstantRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getProductBiddingCategoryConstant(request); } protected  ProductBiddingCategoryConstantServiceClient(
      ProductBiddingCategoryConstantServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  ProductBiddingCategoryConstantServiceClient(
      ProductBiddingCategoryConstantServiceStub stub); static final ProductBiddingCategoryConstantServiceClient create(); static final ProductBiddingCategoryConstantServiceClient create(
      ProductBiddingCategoryConstantServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final ProductBiddingCategoryConstantServiceClient create(
      ProductBiddingCategoryConstantServiceStub stub); final ProductBiddingCategoryConstantServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") ProductBiddingCategoryConstantServiceStub getStub(); final ProductBiddingCategoryConstant getProductBiddingCategoryConstant(
      ProductBiddingCategoryConstantName resourceName); final ProductBiddingCategoryConstant getProductBiddingCategoryConstant(
      String resourceName); final ProductBiddingCategoryConstant getProductBiddingCategoryConstant(
      GetProductBiddingCategoryConstantRequest request); final UnaryCallable<
          GetProductBiddingCategoryConstantRequest, ProductBiddingCategoryConstant> getProductBiddingCategoryConstantCallable(); @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 getProductBiddingCategoryConstantTest() { com.google.ads.googleads.v5.services.ProductBiddingCategoryConstantName resourceName2 = com.google.ads.googleads.v5.services.ProductBiddingCategoryConstantName.of( "[PRODUCT_BIDDING_CATEGORY_CONSTANT]"); ProductBiddingCategoryConstant expectedResponse = ProductBiddingCategoryConstant.newBuilder() .setResourceName(resourceName2.toString()) .build(); mockProductBiddingCategoryConstantService.addResponse(expectedResponse); ProductBiddingCategoryConstantName resourceName = ProductBiddingCategoryConstantName.of("[PRODUCT_BIDDING_CATEGORY_CONSTANT]"); ProductBiddingCategoryConstant actualResponse = client.getProductBiddingCategoryConstant(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockProductBiddingCategoryConstantService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetProductBiddingCategoryConstantRequest actualRequest = (GetProductBiddingCategoryConstantRequest) actualRequests.get(0); Assert.assertEquals( resourceName, ProductBiddingCategoryConstantName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getProductBiddingCategoryConstantExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockProductBiddingCategoryConstantService.addException(exception); try { ProductBiddingCategoryConstantName resourceName = ProductBiddingCategoryConstantName.of("[PRODUCT_BIDDING_CATEGORY_CONSTANT]"); client.getProductBiddingCategoryConstant(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }