// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgressException.java
// public class TransactionInProgressException extends R2dbcNonTransientException {
// 
//   public static final String MSG_READONLY =
//       "Cannot begin a new transaction because a readonly transaction is already in progress.";
//   public static final String MSG_READWRITE =
//       "Cannot begin a new transaction because a read/write transaction is already in progress.";
// 
//   public TransactionInProgressException(boolean isReadwrite) {
//     super(isReadwrite ? MSG_READWRITE : MSG_READONLY);
//   }
// 
// }


import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import com.google.api.core.ApiFutures;
import com.google.cloud.spanner.AsyncTransactionManager;
import com.google.cloud.spanner.AsyncTransactionManager.AsyncTransactionFunction;
import com.google.cloud.spanner.AsyncTransactionManager.AsyncTransactionStep;
import com.google.cloud.spanner.AsyncTransactionManager.TransactionContextFuture;
import com.google.cloud.spanner.DatabaseClient;
import com.google.cloud.spanner.ReadOnlyTransaction;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.TransactionContext;
import com.google.cloud.spanner.r2dbc.TransactionInProgressException;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/*
 * Copyright 2020-2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.spanner.r2dbc.v2;



class DatabaseClientTransactionManagerTest {

  DatabaseClientTransactionManager transactionManager;
  DatabaseClient mockDbClient;
  AsyncTransactionManager mockClientLibraryTransactionManager;
  TransactionContextFuture mockTransactionFuture;
  TransactionContext mockTransactionContext;
  ReadOnlyTransaction mockReadOnlyTransaction;
  AsyncTransactionStep mockAsyncTransactionStep;

  private static PrintStream systemErr;
  private static ByteArrayOutputStream redirectedOutput = new ByteArrayOutputStream();

  @BeforeAll
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgressException.java
// public class TransactionInProgressException extends R2dbcNonTransientException {
// 
//   public static final String MSG_READONLY =
//       "Cannot begin a new transaction because a readonly transaction is already in progress.";
//   public static final String MSG_READWRITE =
//       "Cannot begin a new transaction because a read/write transaction is already in progress.";
// 
//   public TransactionInProgressException(boolean isReadwrite) {
//     super(isReadwrite ? MSG_READWRITE : MSG_READONLY);
//   }
// 
// }


// Path: cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientTransactionManagerTest.java
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import com.google.api.core.ApiFutures;
import com.google.cloud.spanner.AsyncTransactionManager;
import com.google.cloud.spanner.AsyncTransactionManager.AsyncTransactionFunction;
import com.google.cloud.spanner.AsyncTransactionManager.AsyncTransactionStep;
import com.google.cloud.spanner.AsyncTransactionManager.TransactionContextFuture;
import com.google.cloud.spanner.DatabaseClient;
import com.google.cloud.spanner.ReadOnlyTransaction;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.TransactionContext;
import com.google.cloud.spanner.r2dbc.TransactionInProgressException;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/*
 * Copyright 2020-2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.spanner.r2dbc.v2;



class DatabaseClientTransactionManagerTest {

  DatabaseClientTransactionManager transactionManager;
  DatabaseClient mockDbClient;
  AsyncTransactionManager mockClientLibraryTransactionManager;
  TransactionContextFuture mockTransactionFuture;
  TransactionContext mockTransactionContext;
  ReadOnlyTransaction mockReadOnlyTransaction;
  AsyncTransactionStep mockAsyncTransactionStep;

  private static PrintStream systemErr;
  private static ByteArrayOutputStream redirectedOutput = new ByteArrayOutputStream();

  @BeforeAll
  public static void redirectOutput() {