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