MobileAppCategoryConstantServiceClient implements BackgroundResource { public final MobileAppCategoryConstant getMobileAppCategoryConstant( MobileAppCategoryConstantName resourceName) { GetMobileAppCategoryConstantRequest request = GetMobileAppCategoryConstantRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getMobileAppCategoryConstant(request); } protected  MobileAppCategoryConstantServiceClient(
      MobileAppCategoryConstantServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  MobileAppCategoryConstantServiceClient(MobileAppCategoryConstantServiceStub stub); static final MobileAppCategoryConstantServiceClient create(); static final MobileAppCategoryConstantServiceClient create(
      MobileAppCategoryConstantServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final MobileAppCategoryConstantServiceClient create(
      MobileAppCategoryConstantServiceStub stub); final MobileAppCategoryConstantServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") MobileAppCategoryConstantServiceStub getStub(); final MobileAppCategoryConstant getMobileAppCategoryConstant(
      MobileAppCategoryConstantName resourceName); final MobileAppCategoryConstant getMobileAppCategoryConstant(String resourceName); final MobileAppCategoryConstant getMobileAppCategoryConstant(
      GetMobileAppCategoryConstantRequest request); final UnaryCallable<GetMobileAppCategoryConstantRequest, MobileAppCategoryConstant> getMobileAppCategoryConstantCallable(); @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 getMobileAppCategoryConstantTest() { com.google.ads.googleads.v5.services.MobileAppCategoryConstantName resourceName2 = com.google.ads.googleads.v5.services.MobileAppCategoryConstantName.of( "[MOBILE_APP_CATEGORY_CONSTANT]"); int id = 3355; com.google.ads.googleads.v5.services.MobileAppCategoryConstantName name = com.google.ads.googleads.v5.services.MobileAppCategoryConstantName.of( "[MOBILE_APP_CATEGORY_CONSTANT]"); MobileAppCategoryConstant expectedResponse = MobileAppCategoryConstant.newBuilder() .setResourceName(resourceName2.toString()) .setId(id) .setName(name.toString()) .build(); mockMobileAppCategoryConstantService.addResponse(expectedResponse); MobileAppCategoryConstantName resourceName = MobileAppCategoryConstantName.of("[MOBILE_APP_CATEGORY_CONSTANT]"); MobileAppCategoryConstant actualResponse = client.getMobileAppCategoryConstant(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockMobileAppCategoryConstantService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetMobileAppCategoryConstantRequest actualRequest = (GetMobileAppCategoryConstantRequest) actualRequests.get(0); Assert.assertEquals( resourceName, MobileAppCategoryConstantName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getMobileAppCategoryConstantExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockMobileAppCategoryConstantService.addException(exception); try { MobileAppCategoryConstantName resourceName = MobileAppCategoryConstantName.of("[MOBILE_APP_CATEGORY_CONSTANT]"); client.getMobileAppCategoryConstant(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }