CampaignSharedSetServiceClient implements BackgroundResource { public final MutateCampaignSharedSetsResponse mutateCampaignSharedSets( String customerId, List<CampaignSharedSetOperation> operations) { MutateCampaignSharedSetsRequest request = MutateCampaignSharedSetsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCampaignSharedSets(request); } protected  CampaignSharedSetServiceClient(CampaignSharedSetServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignSharedSetServiceClient(CampaignSharedSetServiceStub stub); static final CampaignSharedSetServiceClient create(); static final CampaignSharedSetServiceClient create(
      CampaignSharedSetServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CampaignSharedSetServiceClient create(CampaignSharedSetServiceStub stub); final CampaignSharedSetServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CampaignSharedSetServiceStub getStub(); final CampaignSharedSet getCampaignSharedSet(CampaignSharedSetName resourceName); final CampaignSharedSet getCampaignSharedSet(String resourceName); final CampaignSharedSet getCampaignSharedSet(GetCampaignSharedSetRequest request); final UnaryCallable<GetCampaignSharedSetRequest, CampaignSharedSet> getCampaignSharedSetCallable(); final MutateCampaignSharedSetsResponse mutateCampaignSharedSets(
      String customerId, List<CampaignSharedSetOperation> operations); final MutateCampaignSharedSetsResponse mutateCampaignSharedSets(
      MutateCampaignSharedSetsRequest request); final UnaryCallable<MutateCampaignSharedSetsRequest, MutateCampaignSharedSetsResponse> mutateCampaignSharedSetsCallable(); @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 mutateCampaignSharedSetsTest() { MutateCampaignSharedSetsResponse expectedResponse = MutateCampaignSharedSetsResponse.newBuilder().build(); mockCampaignSharedSetService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CampaignSharedSetOperation> operations = new ArrayList<>(); MutateCampaignSharedSetsResponse actualResponse = client.mutateCampaignSharedSets(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCampaignSharedSetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCampaignSharedSetsRequest actualRequest = (MutateCampaignSharedSetsRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(operations, actualRequest.getOperationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void mutateCampaignSharedSetsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCampaignSharedSetService.addException(exception); try { String customerId = "customerId-1772061412"; List<CampaignSharedSetOperation> operations = new ArrayList<>(); client.mutateCampaignSharedSets(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }