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