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