@Test
public void runInTransactionWithRetriesShouldThrowIfDatastoreNewTransactionFails() throws Exception {

  var cause = new DatastoreIOException(new DatastoreException(1, "", ""));
  doThrow(cause).when(datastore).newTransaction();
  var exception = assertThrows(
      DatastoreIOException.class,
      () -> storage.runInTransactionWithRetries(transactionFunction)
  );
  assertThat(exception, is(cause));
}