Search in sources :

Example 1 with BatchElementCounter

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

the class BatchTest method testBatchElementCounter.

@Test
public void testBatchElementCounter() {
    ElementCounter<Batch<LabeledIntList, List<Integer>>> counter = new BatchElementCounter<>(SQUARER_BATCHING_DESC);
    LabeledIntList request = new LabeledIntList("lable", 3);
    Batch<LabeledIntList, List<Integer>> batch = createBatch(request);
    Truth.assertThat(counter.count(batch)).isEqualTo(1);
}
Also used : 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) BatchElementCounter(com.google.api.gax.rpc.Batch.BatchElementCounter) Test(org.junit.Test)

Aggregations

BatchElementCounter (com.google.api.gax.rpc.Batch.BatchElementCounter)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