Skip to content

Commit beb091d

Browse files
authored
Merge pull request #1648 from SimonMarquis/fix/1647
Initialize DataStore with `TestScope.backgroundScope` in unit tests
2 parents dd516a7 + 96f850f commit beb091d

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

app/prodRelease-badging.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml'
105105
application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml'
106106
application: label='Now in Android' icon='res/mipmap-anydpi-v26/ic_launcher.xml'
107107
launchable-activity: name='com.google.samples.apps.nowinandroid.MainActivity' label='' icon=''
108+
uses-library-not-required:'android.ext.adservices'
108109
uses-library-not-required:'androidx.window.extensions'
109110
uses-library-not-required:'androidx.window.sidecar'
110-
uses-library-not-required:'android.ext.adservices'
111111
feature-group: label=''
112112
uses-feature: name='android.hardware.faketouch'
113113
uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'

core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstNewsRepositoryTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class OfflineFirstNewsRepositoryTest {
7373
@Before
7474
fun setup() {
7575
niaPreferencesDataSource = NiaPreferencesDataSource(
76-
tmpFolder.testUserPreferencesDataStore(testScope),
76+
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
7777
)
7878
newsResourceDao = TestNewsResourceDao()
7979
topicDao = TestTopicDao()

core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstTopicsRepositoryTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class OfflineFirstTopicsRepositoryTest {
6060
topicDao = TestTopicDao()
6161
network = TestNiaNetworkDataSource()
6262
niaPreferences = NiaPreferencesDataSource(
63-
tmpFolder.testUserPreferencesDataStore(testScope),
63+
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
6464
)
6565
synchronizer = TestSynchronizer(niaPreferences)
6666

core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstUserDataRepositoryTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class OfflineFirstUserDataRepositoryTest {
5151
@Before
5252
fun setup() {
5353
niaPreferencesDataSource = NiaPreferencesDataSource(
54-
tmpFolder.testUserPreferencesDataStore(testScope),
54+
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
5555
)
5656

5757
subject = OfflineFirstUserDataRepository(

core/datastore/src/test/kotlin/com/google/samples/apps/nowinandroid/core/datastore/NiaPreferencesDataSourceTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class NiaPreferencesDataSourceTest {
4040
@Before
4141
fun setup() {
4242
subject = NiaPreferencesDataSource(
43-
tmpFolder.testUserPreferencesDataStore(testScope),
43+
tmpFolder.testUserPreferencesDataStore(testScope.backgroundScope),
4444
)
4545
}
4646

0 commit comments

Comments
 (0)