Skip to content

Commit aefc51e

Browse files
committed
test(RemoteConfig): use mock RemoteConfigStates in all unit tests
1 parent 116fd9b commit aefc51e

File tree

3 files changed

+7
-27
lines changed

3 files changed

+7
-27
lines changed

bugsnag-android-core/src/test/java/com/bugsnag/android/DeliveryDelegateTest.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ internal class DeliveryDelegateTest {
2525
@Mock
2626
lateinit var eventStore: EventStore
2727

28+
@Mock
29+
lateinit var remoteConfigState: RemoteConfigState
30+
2831
@get:Rule
2932
val tempDir = TemporaryFolder()
3033

@@ -49,15 +52,7 @@ internal class DeliveryDelegateTest {
4952
config,
5053
DeliveryPipeline(
5154
callbackState,
52-
RemoteConfigState(
53-
RemoteConfigStore(
54-
tempDir.newFolder(),
55-
1
56-
),
57-
config,
58-
notifier,
59-
backgroundTaskService
60-
),
55+
remoteConfigState,
6156
config
6257
),
6358
notifier,

bugsnag-android-core/src/test/java/com/bugsnag/android/EmptyEventCallbackTest.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,7 @@ class EmptyEventCallbackTest {
142142
private fun createEventStore(config: ImmutableConfig): EventStore {
143143
val deliveryPipeline = DeliveryPipeline(
144144
CallbackState(),
145-
RemoteConfigState(
146-
RemoteConfigStore(
147-
tempDir.newFolder(),
148-
1
149-
),
150-
config,
151-
generateConfiguration().notifier,
152-
backgroundTaskService
153-
),
145+
mock(),
154146
config
155147
)
156148

bugsnag-android-core/src/test/java/com/bugsnag/android/LaunchCrashDeliveryTest.kt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import org.junit.Assert.assertEquals
1313
import org.junit.Assert.assertTrue
1414
import org.junit.Before
1515
import org.junit.Test
16+
import org.mockito.Mockito.mock
1617
import java.io.File
1718
import java.lang.Thread
1819
import java.nio.file.Files
@@ -163,15 +164,7 @@ class LaunchCrashDeliveryTest {
163164
val immutableConfig = BugsnagTestUtils.convert(config)
164165
val deliveryPipeline = DeliveryPipeline(
165166
CallbackState(),
166-
RemoteConfigState(
167-
RemoteConfigStore(
168-
File(storageDir, "config"),
169-
1
170-
),
171-
immutableConfig,
172-
generateConfiguration().notifier,
173-
backgroundTaskService
174-
),
167+
mock(),
175168
immutableConfig
176169
)
177170
return EventStore(

0 commit comments

Comments
 (0)