CustomerManagerLinkServiceClient implements BackgroundResource { public final MoveManagerLinkResponse moveManagerLink( String customerId, String previousCustomerManagerLink, String newManager) { MoveManagerLinkRequest request = MoveManagerLinkRequest.newBuilder() .setCustomerId(customerId) .setPreviousCustomerManagerLink(previousCustomerManagerLink) .setNewManager(newManager) .build(); return moveManagerLink(request); } protected  CustomerManagerLinkServiceClient(CustomerManagerLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerManagerLinkServiceClient(CustomerManagerLinkServiceStub stub); static final CustomerManagerLinkServiceClient create(); static final CustomerManagerLinkServiceClient create(
      CustomerManagerLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerManagerLinkServiceClient create(CustomerManagerLinkServiceStub stub); final CustomerManagerLinkServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerManagerLinkServiceStub getStub(); final CustomerManagerLink getCustomerManagerLink(CustomerManagerLinkName resourceName); final CustomerManagerLink getCustomerManagerLink(String resourceName); final CustomerManagerLink getCustomerManagerLink(GetCustomerManagerLinkRequest request); final UnaryCallable<GetCustomerManagerLinkRequest, CustomerManagerLink> getCustomerManagerLinkCallable(); final MutateCustomerManagerLinkResponse mutateCustomerManagerLink(
      String customerId, List<CustomerManagerLinkOperation> operations); final MutateCustomerManagerLinkResponse mutateCustomerManagerLink(
      MutateCustomerManagerLinkRequest request); final UnaryCallable<MutateCustomerManagerLinkRequest, MutateCustomerManagerLinkResponse> mutateCustomerManagerLinkCallable(); final MoveManagerLinkResponse moveManagerLink(
      String customerId, String previousCustomerManagerLink, String newManager); final MoveManagerLinkResponse moveManagerLink(MoveManagerLinkRequest request); final UnaryCallable<MoveManagerLinkRequest, MoveManagerLinkResponse> moveManagerLinkCallable(); @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 moveManagerLinkTest() { String resourceName = "resourceName979421212"; MoveManagerLinkResponse expectedResponse = MoveManagerLinkResponse.newBuilder().setResourceName(resourceName).build(); mockCustomerManagerLinkService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; String previousCustomerManagerLink = "previousCustomerManagerLink-1454597947"; String newManager = "newManager90619918"; MoveManagerLinkResponse actualResponse = client.moveManagerLink(customerId, previousCustomerManagerLink, newManager); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerManagerLinkService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MoveManagerLinkRequest actualRequest = (MoveManagerLinkRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals( previousCustomerManagerLink, actualRequest.getPreviousCustomerManagerLink()); Assert.assertEquals(newManager, actualRequest.getNewManager()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void moveManagerLinkExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerManagerLinkService.addException(exception); try { String customerId = "customerId-1772061412"; String previousCustomerManagerLink = "previousCustomerManagerLink-1454597947"; String newManager = "newManager90619918"; client.moveManagerLink(customerId, previousCustomerManagerLink, newManager); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }