MutateRowsRequestManager { public MutateRowsResponse buildResponse() { List<MutateRowsResponse.Entry> entries = new ArrayList<>(); for (int i = 0; i < results.length; i++) { Status status = (results[i] == null) ? STATUS_INTERNAL : results[i]; entries.add(createEntry(i, status)); } return MutateRowsResponse.newBuilder().addAllEntries(entries).build(); } MutateRowsRequestManager(RetryOptions retryOptions, MutateRowsRequest originalRequest); void onMessage(MutateRowsResponse message); ProcessingStatus onOK(); MutateRowsRequest getRetryRequest(); MutateRowsResponse buildResponse();  }
@Test public void testSingleSuccess() { MutateRowsRequestManager underTest = new MutateRowsRequestManager(retryOptions, createRequest(1)); send(underTest, createResponse(OK)); Assert.assertEquals(createResponse(OK), underTest.buildResponse()); }
@Test public void testNotRetryable() { MutateRowsRequestManager underTest = new MutateRowsRequestManager(retryOptions, createRequest(3)); Assert.assertEquals( ProcessingStatus.NOT_RETRYABLE, send(underTest, createResponse(OK, OK, NOT_FOUND))); Assert.assertEquals(createResponse(OK, OK, NOT_FOUND), underTest.buildResponse()); }
@Test public void testEmptySuccess() { MutateRowsRequestManager underTest = new MutateRowsRequestManager(retryOptions, createRequest(0)); send(underTest, createResponse()); Assert.assertEquals(createResponse(), underTest.buildResponse()); }