Fix database/impl androidTest. We need the 22.json schema file, since the test tests the migration. The junit-jupiter-api dependency causes errors during build (when the package is merged) and it's not needed for androidTest.

This commit is contained in:
Robert Buessow 2023-10-12 19:45:25 +02:00
parent 44b8b30637
commit bb133cdbce
3 changed files with 3609 additions and 5 deletions

View file

@ -13,7 +13,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.test.ext:junit-ktx:$androidx_junit_version"
androidTestImplementation "androidx.test:rules:$androidx_rules_version"
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version"
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
internal class HeartRateDaoTest {
class HeartRateDaoTest {
private val context = ApplicationProvider.getApplicationContext<Context>()
private fun createDatabase() =
@ -86,9 +86,9 @@ internal class HeartRateDaoTest {
dao.insertNewEntry(hr1)
dao.insertNewEntry(hr2)
assertEquals(listOf(hr1, hr2), dao.getFromTime(timestamp))
assertEquals(listOf(hr2), dao.getFromTime(timestamp + 1))
assertTrue(dao.getFromTime(timestamp + 2).isEmpty())
assertEquals(listOf(hr1, hr2), dao.getFromTime(timestamp).blockingGet())
assertEquals(listOf(hr2), dao.getFromTime(timestamp + 1).blockingGet())
assertTrue(dao.getFromTime(timestamp + 2).blockingGet().isEmpty())
}
}