Simplify boolean value sources for base tests

This commit is contained in:
Justin Lu 2026-01-16 15:18:06 -08:00
parent 26c380b9ad
commit 757e796666
5 changed files with 8 additions and 15 deletions

View File

@ -22,6 +22,7 @@
*/
package test.sql;
import org.junit.jupiter.params.provider.ValueSource;
import util.BaseTest;
import util.StubConnection;
@ -98,7 +99,7 @@ public class CallableStatementTests extends BaseTest {
* enquoteIdentiifer is null
*/
@ParameterizedTest
@MethodSource("trueFalse")
@ValueSource(booleans = {true, false})
public void test04(boolean alwaysQuote) throws SQLException {
Assertions.assertThrows(NullPointerException.class, () -> {
cstmt.enquoteIdentifier(null, alwaysQuote);

View File

@ -22,6 +22,7 @@
*/
package test.sql;
import org.junit.jupiter.params.provider.ValueSource;
import util.BaseTest;
import util.StubConnection;
@ -92,7 +93,7 @@ public class ConnectionTests extends BaseTest {
* enquoteIdentiifer is null
*/
@ParameterizedTest
@MethodSource("trueFalse")
@ValueSource(booleans = {true, false})
public void test04(boolean alwaysQuote) throws SQLException {
Assertions.assertThrows(NullPointerException.class, () -> {
conn.enquoteIdentifier(null, alwaysQuote);

View File

@ -22,6 +22,7 @@
*/
package test.sql;
import org.junit.jupiter.params.provider.ValueSource;
import util.BaseTest;
import util.StubConnection;
@ -99,7 +100,7 @@ public class PreparedStatementTests extends BaseTest {
* enquoteIdentiifer is null
*/
@ParameterizedTest
@MethodSource("trueFalse")
@ValueSource(booleans = {true, false})
public void test04(boolean alwaysQuote) throws SQLException {
Assertions.assertThrows(NullPointerException.class, () -> {
pstmt.enquoteIdentifier(null, alwaysQuote);

View File

@ -34,6 +34,7 @@ import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import util.BaseTest;
import util.StubConnection;
@ -98,7 +99,7 @@ public class StatementTests extends BaseTest {
* enquoteIdentiifer is null
*/
@ParameterizedTest
@MethodSource("trueFalse")
@ValueSource(booleans = {true, false})
public void test04(boolean alwaysQuote) throws SQLException {
Assertions.assertThrows(NullPointerException.class, () -> {
stmt.enquoteIdentifier(null, alwaysQuote);

View File

@ -74,17 +74,6 @@ public class BaseTest {
return o1;
}
/*
* DataProvider used to specify the value to set and check for
* methods using boolean values
*/
protected Object[][] trueFalse() {
return new Object[][]{
{true},
{false}
};
}
/*
* DataProvider used to specify the standard JDBC Types
*/