Search in sources :

Example 1 with BatchByteCounter

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

the class BatchTest method testBatchByteCounter.

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

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