Skip to content

Commit

Permalink
Fix instrumentation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiembo authored and florina-muntenescu committed Oct 21, 2018
1 parent 56c2abb commit 28608aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ dependencies {
androidTestImplementation "com.squareup.retrofit2:retrofit-mock:${versions.retrofit}"

// Work around issue with runtime classpath version conflict
androidTestImplementation "androidx.arch.core:core-testing:${versions.lifecycle}"
androidTestImplementation "androidx.legacy:legacy-support-core-utils:${versions.legacyCoreUtils}"
androidTestImplementation "androidx.lifecycle:lifecycle-runtime:${versions.lifecycle}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.plaidapp.core.designernews.data.database

import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.room.Room
import androidx.test.InstrumentationRegistry
import io.plaidapp.core.designernews.data.login.model.LoggedInUser
Expand All @@ -24,6 +25,7 @@ import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Before
import org.junit.Rule
import org.junit.Test

/**
Expand All @@ -34,6 +36,9 @@ class LoggedInUserDaoTest {
private lateinit var loggedInUser: LoggedInUser
private lateinit var loggedInUserDao: LoggedInUserDao

@get:Rule
var instantTaskExecutorRule = InstantTaskExecutorRule()

@Before fun setup() {
val context = InstrumentationRegistry.getInstrumentation().context
database = Room.inMemoryDatabaseBuilder(context, DesignerNewsDatabase::class.java).build()
Expand Down

0 comments on commit 28608aa

Please sign in to comment.