GeographicViewServiceClient implements BackgroundResource { public final GeographicView getGeographicView(GeographicViewName resourceName) { GetGeographicViewRequest request = GetGeographicViewRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getGeographicView(request); } protected  GeographicViewServiceClient(GeographicViewServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  GeographicViewServiceClient(GeographicViewServiceStub stub); static final GeographicViewServiceClient create(); static final GeographicViewServiceClient create(GeographicViewServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final GeographicViewServiceClient create(GeographicViewServiceStub stub); final GeographicViewServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") GeographicViewServiceStub getStub(); final GeographicView getGeographicView(GeographicViewName resourceName); final GeographicView getGeographicView(String resourceName); final GeographicView getGeographicView(GetGeographicViewRequest request); final UnaryCallable<GetGeographicViewRequest, GeographicView> getGeographicViewCallable(); @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 getGeographicViewTest() { com.google.ads.googleads.v5.services.GeographicViewName resourceName2 = com.google.ads.googleads.v5.services.GeographicViewName.of( "[CUSTOMER]", "[GEOGRAPHIC_VIEW]"); long countryCriterionId = 1427674750L; GeographicView expectedResponse = GeographicView.newBuilder() .setResourceName(resourceName2.toString()) .setCountryCriterionId(countryCriterionId) .build(); mockGeographicViewService.addResponse(expectedResponse); GeographicViewName resourceName = GeographicViewName.of("[CUSTOMER]", "[GEOGRAPHIC_VIEW]"); GeographicView actualResponse = client.getGeographicView(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockGeographicViewService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetGeographicViewRequest actualRequest = (GetGeographicViewRequest) actualRequests.get(0); Assert.assertEquals(resourceName, GeographicViewName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getGeographicViewExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockGeographicViewService.addException(exception); try { GeographicViewName resourceName = GeographicViewName.of("[CUSTOMER]", "[GEOGRAPHIC_VIEW]"); client.getGeographicView(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }