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