All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gruelbox.transactionoutbox.testing.TestUtils Maven / Gradle / Ivy

There is a newer version: 6.0.553
Show newest version
package com.gruelbox.transactionoutbox.testing;

import com.gruelbox.transactionoutbox.TransactionManager;
import java.sql.Statement;

public class TestUtils {

  @SuppressWarnings("SameParameterValue")
  public static void runSql(TransactionManager transactionManager, String sql) {
    transactionManager.inTransaction(
        tx -> {
          try {
            try (Statement statement = tx.connection().createStatement()) {
              statement.execute(sql);
            }
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        });
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy