diff --git a/pom.xml b/pom.xml
index bdc9366..91f3180 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,15 +119,15 @@
test
- com.google.code.gson
- gson
- 2.9.0
+ org.junit.jupiter
+ junit-jupiter
+ 5.11.1
test
- junit
- junit
- 4.13.1
+ com.google.code.gson
+ gson
+ 2.9.0
test
diff --git a/src/test/java/com/google/api/services/bigquery/MinifiedBigqueryTest.java b/src/test/java/com/google/api/services/bigquery/MinifiedBigqueryTest.java
index 7ce6849..562ba33 100644
--- a/src/test/java/com/google/api/services/bigquery/MinifiedBigqueryTest.java
+++ b/src/test/java/com/google/api/services/bigquery/MinifiedBigqueryTest.java
@@ -4,7 +4,7 @@
import com.google.api.client.testing.http.MockHttpTransport;
import com.google.api.client.testing.json.MockJsonFactory;
import org.assertj.core.api.Assertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class MinifiedBigqueryTest {
diff --git a/src/test/java/net/starschema/clouddb/jdbc/BQForwardOnlyResultSetFunctionTest.java b/src/test/java/net/starschema/clouddb/jdbc/BQForwardOnlyResultSetFunctionTest.java
index 5ffaa53..8000e1f 100644
--- a/src/test/java/net/starschema/clouddb/jdbc/BQForwardOnlyResultSetFunctionTest.java
+++ b/src/test/java/net/starschema/clouddb/jdbc/BQForwardOnlyResultSetFunctionTest.java
@@ -20,6 +20,8 @@
*/
package net.starschema.clouddb.jdbc;
+import static org.junit.jupiter.api.Assertions.*;
+
import com.google.api.client.testing.http.MockHttpTransport;
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
import com.google.api.services.bigquery.model.Job;
@@ -45,11 +47,10 @@
import java.util.Map;
import java.util.Properties;
import java.util.TimeZone;
-import junit.framework.Assert;
import org.assertj.core.api.Assertions;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,22 +73,22 @@ private Connection connect(final String extraUrl) throws SQLException, IOExcepti
return ConnectionFromResources.connect("installedaccount1.properties", extraUrl);
}
- @Before
+ @BeforeEach
public void setConnection() throws SQLException, IOException {
connection = connect("&useLegacySql=true");
}
- @Before
+ @BeforeEach
public void setStandardSqlConnection() throws SQLException, IOException {
standardSqlConnection = connect("&useLegacySql=false");
}
- @After
+ @AfterEach
public void closeConnection() throws SQLException {
connection.close();
}
- @After
+ @AfterEach
public void closeStandardSqlConnection() throws SQLException {
standardSqlConnection.close();
}
@@ -105,42 +106,42 @@ public void ChainedCursorFunctionTest() {
this.QueryLoad();
this.logger.info("ChainedFunctionTest");
try {
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("you", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("you", resultForTest.getString(1));
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
try {
resultForTest.absolute(10);
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
}
try {
for (int i = 0; i < 9; i++) {
- Assert.assertTrue(resultForTest.next());
+ assertTrue(resultForTest.next());
}
- Assert.assertFalse(resultForTest.next());
+ assertFalse(resultForTest.next());
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
try {
- Assert.assertEquals("", resultForTest.getString(1));
+ assertEquals("", resultForTest.getString(1));
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
}
QueryLoad();
try {
resultForTest.next();
- Assert.assertEquals("you", resultForTest.getString(1));
+ assertEquals("you", resultForTest.getString(1));
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
this.logger.info("chainedfunctiontest end");
}
@@ -156,10 +157,10 @@ public void databaseMetaDataGetTables() {
.getColumns(null, "starschema_net__clouddb", "OUTLET_LOOKUP", null);
} catch (SQLException e) {
e.printStackTrace();
- Assert.fail();
+ fail();
}
try {
- Assert.assertTrue(result.first());
+ assertTrue(result.first());
while (!result.isAfterLast()) {
String toprint = "";
toprint += result.getString(1) + " , ";
@@ -177,7 +178,7 @@ public void databaseMetaDataGetTables() {
}
} catch (SQLException e) {
e.printStackTrace();
- Assert.fail();
+ fail();
}
}
@@ -186,21 +187,21 @@ public void databaseMetaDataGetTables() {
public void isClosedValidtest() {
this.QueryLoad();
try {
- Assert.assertEquals(true, connection.isValid(0));
+ assertEquals(true, connection.isValid(0));
} catch (SQLException e) {
- Assert.fail("Got an exception" + e.toString());
+ fail("Got an exception" + e.toString());
e.printStackTrace();
}
try {
- Assert.assertEquals(true, connection.isValid(10));
+ assertEquals(true, connection.isValid(10));
} catch (SQLException e) {
- Assert.fail("Got an exception" + e.toString());
+ fail("Got an exception" + e.toString());
e.printStackTrace();
}
try {
connection.isValid(-10);
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
// e.printStackTrace();
}
@@ -210,7 +211,7 @@ public void isClosedValidtest() {
e.printStackTrace();
}
try {
- Assert.assertTrue(connection.isClosed());
+ assertTrue(connection.isClosed());
} catch (SQLException e1) {
e1.printStackTrace();
}
@@ -218,7 +219,7 @@ public void isClosedValidtest() {
try {
connection.isValid(0);
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
e.printStackTrace();
}
}
@@ -242,9 +243,9 @@ public void QueryLoad() {
resultForTest = stmt.executeQuery(sql);
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
- Assert.assertNotNull(resultForTest);
+ assertNotNull(resultForTest);
}
@Test
@@ -256,7 +257,7 @@ public void ResultSetMetadata() {
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
}
- Assert.assertTrue(true);
+ assertTrue(true);
}
@Test
@@ -265,7 +266,7 @@ public void TestResultIndexOutofBound() {
try {
this.logger.debug("{}", resultForTest.getBoolean(99));
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
this.logger.error("SQLexception" + e.toString());
}
}
@@ -276,10 +277,10 @@ public void TestResultSetFirst() {
try {
// Assert.assertTrue(resultForTest.first());
resultForTest.next();
- Assert.assertTrue(resultForTest.isFirst());
+ assertTrue(resultForTest.isFirst());
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
}
@@ -287,11 +288,11 @@ public void TestResultSetFirst() {
public void TestResultSetgetBoolean() {
this.QueryLoad();
try {
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals(Boolean.parseBoolean("42"), resultForTest.getBoolean(2));
+ assertTrue(resultForTest.next());
+ assertEquals(Boolean.parseBoolean("42"), resultForTest.getBoolean(2));
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
}
@@ -299,11 +300,11 @@ public void TestResultSetgetBoolean() {
public void TestResultSetgetFloat() {
this.QueryLoad();
try {
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals(42f, resultForTest.getFloat(2));
+ assertTrue(resultForTest.next());
+ assertEquals(42f, resultForTest.getFloat(2));
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
}
@@ -311,11 +312,11 @@ public void TestResultSetgetFloat() {
public void TestResultSetgetInteger() {
this.QueryLoad();
try {
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals(42, resultForTest.getInt(2));
+ assertTrue(resultForTest.next());
+ assertEquals(42, resultForTest.getInt(2));
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
}
@@ -323,10 +324,10 @@ public void TestResultSetgetInteger() {
public void TestResultSetgetRow() {
this.QueryLoad();
try {
- Assert.assertTrue(resultForTest.next());
+ assertTrue(resultForTest.next());
resultForTest.getRow();
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
}
}
@@ -334,11 +335,11 @@ public void TestResultSetgetRow() {
public void TestResultSetgetString() {
this.QueryLoad();
try {
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("you", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("you", resultForTest.getString(1));
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
}
@@ -353,35 +354,35 @@ public void TestResultSetNext() {
this.QueryLoad();
try {
// Assert.assertTrue(resultForTest.first());
- Assert.assertTrue(resultForTest.next());
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("yet", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("would", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("world", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("without", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("with", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("will", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("why", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("whose", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("whom", resultForTest.getString(1));
- Assert.assertFalse(resultForTest.next());
+ assertTrue(resultForTest.next());
+ assertTrue(resultForTest.next());
+ assertEquals("yet", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("would", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("world", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("without", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("with", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("will", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("why", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("whose", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("whom", resultForTest.getString(1));
+ assertFalse(resultForTest.next());
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
try {
- Assert.assertEquals("", resultForTest.getString(1));
+ assertEquals("", resultForTest.getString(1));
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
}
}
@@ -391,35 +392,35 @@ public void TestResultSetNextWhenFetchSizeExceeded() throws SQLException {
resultForTest.setFetchSize(2);
try {
// Assert.assertTrue(resultForTest.first());
- Assert.assertTrue(resultForTest.next());
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("yet", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("would", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("world", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("without", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("with", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("will", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("why", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("whose", resultForTest.getString(1));
- Assert.assertTrue(resultForTest.next());
- Assert.assertEquals("whom", resultForTest.getString(1));
- Assert.assertFalse(resultForTest.next());
+ assertTrue(resultForTest.next());
+ assertTrue(resultForTest.next());
+ assertEquals("yet", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("would", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("world", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("without", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("with", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("will", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("why", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("whose", resultForTest.getString(1));
+ assertTrue(resultForTest.next());
+ assertEquals("whom", resultForTest.getString(1));
+ assertFalse(resultForTest.next());
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
try {
- Assert.assertEquals("", resultForTest.getString(1));
+ assertEquals("", resultForTest.getString(1));
} catch (SQLException e) {
- Assert.assertTrue(true);
+ assertTrue(true);
}
}
@@ -442,10 +443,10 @@ public void testResultSetTypesInGetString() throws SQLException {
result = stmt.executeQuery(sql);
} catch (SQLException e) {
this.logger.error("SQLexception" + e.toString());
- Assert.fail("SQLException" + e.toString());
+ fail("SQLException" + e.toString());
}
- Assert.assertNotNull(result);
- Assert.assertTrue(result.next());
+ assertNotNull(result);
+ assertTrue(result.next());
HashMap hello =
new HashMap() {
@@ -462,29 +463,29 @@ public void testResultSetTypesInGetString() throws SQLException {
}
};
- Assert.assertEquals(
+ assertEquals(
hello,
new Gson()
.fromJson(result.getString(1), new TypeToken