### Question:
MerchantCenterLinkServiceClient implements BackgroundResource { public final MutateMerchantCenterLinkResponse mutateMerchantCenterLink( String customerId, MerchantCenterLinkOperation operation) { MutateMerchantCenterLinkRequest request = MutateMerchantCenterLinkRequest.newBuilder() .setCustomerId(customerId) .setOperation(operation) .build(); return mutateMerchantCenterLink(request); } protected  MerchantCenterLinkServiceClient(MerchantCenterLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  MerchantCenterLinkServiceClient(MerchantCenterLinkServiceStub stub); static final MerchantCenterLinkServiceClient create(); static final MerchantCenterLinkServiceClient create(
      MerchantCenterLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final MerchantCenterLinkServiceClient create(MerchantCenterLinkServiceStub stub); final MerchantCenterLinkServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") MerchantCenterLinkServiceStub getStub(); final ListMerchantCenterLinksResponse listMerchantCenterLinks(String customerId); final ListMerchantCenterLinksResponse listMerchantCenterLinks(
      ListMerchantCenterLinksRequest request); final UnaryCallable<ListMerchantCenterLinksRequest, ListMerchantCenterLinksResponse> listMerchantCenterLinksCallable(); final MerchantCenterLink getMerchantCenterLink(MerchantCenterLinkName resourceName); final MerchantCenterLink getMerchantCenterLink(String resourceName); final MerchantCenterLink getMerchantCenterLink(GetMerchantCenterLinkRequest request); final UnaryCallable<GetMerchantCenterLinkRequest, MerchantCenterLink> getMerchantCenterLinkCallable(); final MutateMerchantCenterLinkResponse mutateMerchantCenterLink(
      String customerId, MerchantCenterLinkOperation operation); final MutateMerchantCenterLinkResponse mutateMerchantCenterLink(
      MutateMerchantCenterLinkRequest request); final UnaryCallable<MutateMerchantCenterLinkRequest, MutateMerchantCenterLinkResponse> mutateMerchantCenterLinkCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }### Answer:
@Test @SuppressWarnings("all") public void mutateMerchantCenterLinkTest() { MutateMerchantCenterLinkResponse expectedResponse = MutateMerchantCenterLinkResponse.newBuilder().build(); mockMerchantCenterLinkService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; MerchantCenterLinkOperation operation = MerchantCenterLinkOperation.newBuilder().build(); MutateMerchantCenterLinkResponse actualResponse = client.mutateMerchantCenterLink(customerId, operation); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockMerchantCenterLinkService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateMerchantCenterLinkRequest actualRequest = (MutateMerchantCenterLinkRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(operation, actualRequest.getOperation()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void mutateMerchantCenterLinkExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockMerchantCenterLinkService.addException(exception); try { String customerId = "customerId-1772061412"; MerchantCenterLinkOperation operation = MerchantCenterLinkOperation.newBuilder().build(); client.mutateMerchantCenterLink(customerId, operation); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }