Skip to content

Commit 0694cf2

Browse files
committed
[misc] test addition : ensure connection error SQLstate
1 parent 819eeb2 commit 0694cf2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/test/java/org/mariadb/jdbc/integration/ErrorTest.java

+11-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
import static org.junit.jupiter.api.Assertions.*;
77

88
import java.sql.*;
9-
import org.junit.jupiter.api.AfterAll;
10-
import org.junit.jupiter.api.Assumptions;
11-
import org.junit.jupiter.api.BeforeAll;
12-
import org.junit.jupiter.api.Test;
9+
10+
import org.junit.jupiter.api.*;
1311

1412
public class ErrorTest extends Common {
1513

@@ -146,4 +144,13 @@ public void deadLockInformation() throws SQLException {
146144
}
147145
}
148146
}
147+
@Test
148+
public void connectionErrorFormat() throws SQLException {
149+
try {
150+
DriverManager.getConnection("jdbc:mariadb://localhost:3000/db");
151+
fail("Must have thrown an error");
152+
} catch (SQLException e) {
153+
assertEquals("08000", e.getSQLState());
154+
}
155+
}
149156
}

0 commit comments

Comments
 (0)