@Test
public void testInvalidPut() throws Exception {

  when(mockBulkMutation.add(any(RowMutationEntry.class)))
      .thenReturn(ApiFutures.<Void>immediateFailedFuture(new RuntimeException()));
  BigtableBufferedMutator underTest = createMutator(new Configuration(false));
  underTest.mutate(SIMPLE_PUT);
  // Leave some time for the async worker to handle the request.
  verify(listener, times(0))
      .onException(any(RetriesExhaustedWithDetailsException.class), same(underTest));
  underTest.mutate(SIMPLE_PUT);
  verify(listener, times(1))
      .onException(any(RetriesExhaustedWithDetailsException.class), same(underTest));
}