mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-03 08:24:19 +01:00
Add JDBC.java
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package org.github.tursodatabase;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
|
||||
|
||||
class JDBCTest {
|
||||
|
||||
@Test
|
||||
void null_is_returned_when_invalid_url_is_passed() throws Exception {
|
||||
LimboConnection connection = JDBC.createConnection("jdbc:invalid:xxx", new Properties());
|
||||
assertThat(connection).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void non_null_connection_is_returned_when_valid_url_is_passed() throws Exception {
|
||||
String fileUrl = TestUtils.createTempFile();
|
||||
LimboConnection connection = JDBC.createConnection("jdbc:limbo:" + fileUrl, new Properties());
|
||||
assertThat(connection).isNotNull();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user