SharedSetServiceClient implements BackgroundResource { public final MutateSharedSetsResponse mutateSharedSets( String customerId, List<SharedSetOperation> operations) { MutateSharedSetsRequest request = MutateSharedSetsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateSharedSets(request); } protected  SharedSetServiceClient(SharedSetServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  SharedSetServiceClient(SharedSetServiceStub stub); static final SharedSetServiceClient create(); static final SharedSetServiceClient create(SharedSetServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final SharedSetServiceClient create(SharedSetServiceStub stub); final SharedSetServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") SharedSetServiceStub getStub(); final SharedSet getSharedSet(SharedSetName resourceName); final SharedSet getSharedSet(String resourceName); final SharedSet getSharedSet(GetSharedSetRequest request); final UnaryCallable<GetSharedSetRequest, SharedSet> getSharedSetCallable(); final MutateSharedSetsResponse mutateSharedSets(
      String customerId, List<SharedSetOperation> operations); final MutateSharedSetsResponse mutateSharedSets(MutateSharedSetsRequest request); final UnaryCallable<MutateSharedSetsRequest, MutateSharedSetsResponse> mutateSharedSetsCallable(); @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 mutateSharedSetsTest() { MutateSharedSetsResponse expectedResponse = MutateSharedSetsResponse.newBuilder().build(); mockSharedSetService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<SharedSetOperation> operations = new ArrayList<>(); MutateSharedSetsResponse actualResponse = client.mutateSharedSets(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockSharedSetService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateSharedSetsRequest actualRequest = (MutateSharedSetsRequest) 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 mutateSharedSetsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockSharedSetService.addException(exception); try { String customerId = "customerId-1772061412"; List<SharedSetOperation> operations = new ArrayList<>(); client.mutateSharedSets(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }