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