Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim203 committed Feb 11, 2024
1 parent 0dcbc9f commit 2d85131
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/test/java/org/geysermc/databaseutils/SqlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
import java.util.concurrent.Executors;
import org.geysermc.databaseutils.data.BasicRepository;
import org.geysermc.databaseutils.data.TestEntity;
import org.geysermc.databaseutils.sql.SqlDialect;
import org.junit.jupiter.api.Test;

final class SqlTest {
@Test
void hello() throws ExecutionException, InterruptedException {
var utils = DatabaseUtils.builder()
.config(new DatabaseConfig("jdbc:h2:./test", "sa", "", "hello", 2))
.config(new DatabaseConfig("jdbc:h2:./test", "sa", "", "hello", 2, SqlDialect.H2))
.executorService(Executors.newCachedThreadPool())
.build();
utils.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@ public static SqlDialect byName(String dialectName) {
}
return null;
}

public static SqlDialect requireByName(String dialectName) {
var result = byName(dialectName);
if (result == null) {
throw new IllegalStateException("Could not find dialect for " + dialectName);
}
return result;
}
}

0 comments on commit 2d85131

Please sign in to comment.