Using in memory databases for the test cases

This commit is contained in:
Vitor Pamplona
2025-12-24 17:09:33 -05:00
parent 09eeebba94
commit 77e56f86a9
4 changed files with 4 additions and 10 deletions
@@ -41,15 +41,12 @@ class AddressableTest {
@Before @Before
fun setup() { fun setup() {
val context = ApplicationProvider.getApplicationContext<Context>() val context = ApplicationProvider.getApplicationContext<Context>()
context.deleteDatabase("test.db") db = EventStore(context, null)
db = EventStore(context, "test.db", relayUrl = "testUrl")
} }
@After @After
fun tearDown() { fun tearDown() {
db.close() db.close()
val context = ApplicationProvider.getApplicationContext<Context>()
context.deleteDatabase("test.db")
} }
@Test @Test
@@ -42,7 +42,7 @@ class ExpirationTest {
@Before @Before
fun setup() { fun setup() {
val context = ApplicationProvider.getApplicationContext<Context>() val context = ApplicationProvider.getApplicationContext<Context>()
db = EventStore(context, null, relayUrl = "testUrl") db = EventStore(context, null)
} }
@After @After
@@ -56,15 +56,12 @@ class LargeDBTests {
@Before @Before
fun setup() { fun setup() {
val context = ApplicationProvider.getApplicationContext<Context>() val context = ApplicationProvider.getApplicationContext<Context>()
context.deleteDatabase("test_large.db") db = EventStore(context, null)
db = EventStore(context, "largeDBTest.db")
} }
@After @After
fun tearDown() { fun tearDown() {
db.close() db.close()
val context = ApplicationProvider.getApplicationContext<Context>()
context.deleteDatabase("test_large.db")
} }
@Test @Test
@@ -41,7 +41,7 @@ class ReplaceableTest {
@Before @Before
fun setup() { fun setup() {
val context = ApplicationProvider.getApplicationContext<Context>() val context = ApplicationProvider.getApplicationContext<Context>()
db = EventStore(context, null, relayUrl = "testUrl") db = EventStore(context, null)
} }
@After @After