
com.gruelbox.transactionoutbox.testing.TestUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transactionoutbox-testing Show documentation
Show all versions of transactionoutbox-testing Show documentation
A safe implementation of the transactional outbox pattern for Java (core library)
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