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