GeoTargetConstantServiceClient implements BackgroundResource { public final SuggestGeoTargetConstantsResponse suggestGeoTargetConstants( SuggestGeoTargetConstantsRequest request) { return suggestGeoTargetConstantsCallable().call(request); } protected  GeoTargetConstantServiceClient(GeoTargetConstantServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  GeoTargetConstantServiceClient(GeoTargetConstantServiceStub stub); static final GeoTargetConstantServiceClient create(); static final GeoTargetConstantServiceClient create(
      GeoTargetConstantServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final GeoTargetConstantServiceClient create(GeoTargetConstantServiceStub stub); final GeoTargetConstantServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") GeoTargetConstantServiceStub getStub(); final GeoTargetConstant getGeoTargetConstant(GeoTargetConstantName resourceName); final GeoTargetConstant getGeoTargetConstant(String resourceName); final GeoTargetConstant getGeoTargetConstant(GetGeoTargetConstantRequest request); final UnaryCallable<GetGeoTargetConstantRequest, GeoTargetConstant> getGeoTargetConstantCallable(); final SuggestGeoTargetConstantsResponse suggestGeoTargetConstants(
      SuggestGeoTargetConstantsRequest request); final UnaryCallable<SuggestGeoTargetConstantsRequest, SuggestGeoTargetConstantsResponse> suggestGeoTargetConstantsCallable(); @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 suggestGeoTargetConstantsTest() { SuggestGeoTargetConstantsResponse expectedResponse = SuggestGeoTargetConstantsResponse.newBuilder().build(); mockGeoTargetConstantService.addResponse(expectedResponse); SuggestGeoTargetConstantsRequest request = SuggestGeoTargetConstantsRequest.newBuilder().build(); SuggestGeoTargetConstantsResponse actualResponse = client.suggestGeoTargetConstants(request); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockGeoTargetConstantService.getRequests(); Assert.assertEquals(1, actualRequests.size()); SuggestGeoTargetConstantsRequest actualRequest = (SuggestGeoTargetConstantsRequest) actualRequests.get(0); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void suggestGeoTargetConstantsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockGeoTargetConstantService.addException(exception); try { SuggestGeoTargetConstantsRequest request = SuggestGeoTargetConstantsRequest.newBuilder().build(); client.suggestGeoTargetConstants(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }