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