Search in sources :

Example 1 with BatchMergerImpl

use of com.google.api.gax.rpc.Batch.BatchMergerImpl in project gax-java by googleapis.

the class BatchTest method testBatchMergerImpl.

@Test
public void testBatchMergerImpl() {
    LabeledIntList request1 = new LabeledIntList("lable", 1);
    Batch<LabeledIntList, List<Integer>> batch1 = createBatch(request1);
    LabeledIntList request2 = new LabeledIntList("lable", 2);
    Batch<LabeledIntList, List<Integer>> batch2 = createBatch(request2);
    BatchMergerImpl<LabeledIntList, List<Integer>> batchMerger = new BatchMergerImpl<>();
    batchMerger.merge(batch1, batch2);
    Truth.assertThat(batch1.getByteCount()).isEqualTo(3);
}
Also used : BatchMergerImpl(com.google.api.gax.rpc.Batch.BatchMergerImpl) LabeledIntList(com.google.api.gax.rpc.testing.FakeBatchableApi.LabeledIntList) ArrayList(java.util.ArrayList) List(java.util.List) LabeledIntList(com.google.api.gax.rpc.testing.FakeBatchableApi.LabeledIntList) Test(org.junit.Test)

Aggregations

BatchMergerImpl (com.google.api.gax.rpc.Batch.BatchMergerImpl)1 LabeledIntList (com.google.api.gax.rpc.testing.FakeBatchableApi.LabeledIntList)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Test (org.junit.Test)1