fix(android): Add Robolectric SDK config for tests
Added @Config(sdk = [28]) annotation to DailyNotificationRecoveryTests to fix Robolectric initialization error (targetSdkVersion=35 > maxSdkVersion=34). All 3 combined edge case tests now pass: - test_combined_dst_boundary_duplicate_delivery_cold_start ✅ - test_combined_rollover_duplicate_delivery_cold_start ✅ - test_combined_schema_version_cold_start_recovery ✅
This commit is contained in:
@@ -49,8 +49,9 @@ android {
|
||||
testOptions {
|
||||
unitTests.all {
|
||||
enabled = true
|
||||
includeAndroidResources = true // Enable Robolectric if used
|
||||
}
|
||||
// Enable Android resources for Robolectric (only for test tasks, not all tasks)
|
||||
unitTests.includeAndroidResources = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.junit.Test
|
||||
import org.junit.After
|
||||
import org.junit.Assert.*
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
import org.junit.runner.RunWith
|
||||
import java.util.Calendar
|
||||
import java.util.TimeZone
|
||||
@@ -38,6 +39,7 @@ import java.util.UUID
|
||||
* @resilience @combined-scenarios
|
||||
*/
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [28]) // Use API 28 for Robolectric
|
||||
class DailyNotificationRecoveryTests {
|
||||
|
||||
private lateinit var context: Context
|
||||
|
||||
Reference in New Issue
Block a user