Skip to content
Snippets Groups Projects
Commit 0ead2a80 authored by Sebastian's avatar Sebastian
Browse files

Actually encrypt database in test

parent f21c6811
No related branches found
No related tags found
No related merge requests found
Pipeline #7354 failed
......@@ -2,6 +2,7 @@ package org.briarproject.mailbox.core.db
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.Test
import org.sqlite.mc.SQLiteMCConfig
import java.nio.file.Files
import java.nio.file.Path
import java.sql.Connection
......@@ -15,7 +16,8 @@ class DatabaseCreationTest {
fun createDatabase(): Unit = runBlocking {
val file: Path = Files.createTempFile("test", ".sqlite")
println(file)
val connection: Connection = DriverManager.getConnection("jdbc:sqlite:$file")
val connection: Connection = DriverManager.getConnection("jdbc:sqlite:$file",
SQLiteMCConfig().withKey("very-secret").toProperties())
val stmt = connection.createStatement()
stmt.executeUpdate("CREATE TABLE students (id integer, name string)")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment