Skip to content

Commit 19273ca

Browse files
[Common] Replace hardcoded SDK version with Config.OLDEST_SDK (2) (#7060)
Tests will use the Config.OLDEST_SDK instead of a hardcoded SDK if the corresponding hardcoded SDK would be below our intended minSdk. I'll also need to re-evaluate whether these tests are necessary to keep around, or if they are irrelevant when bumping the minSdk. Related to cl/769912845 Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 68535a4 commit 19273ca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

firebase-common/src/test/java/com/google/firebase/DataCollectionPreNDefaultEnabledTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.robolectric.annotation.Config;
2828

2929
@RunWith(AndroidJUnit4.class)
30-
@Config(sdk = 21)
30+
@Config(sdk = Config.OLDEST_SDK)
3131
public class DataCollectionPreNDefaultEnabledTest {
3232

3333
@Test

firebase-common/src/test/java/com/google/firebase/platforminfo/FirebasePlatformLoggingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void test_auto_atHighEnoughApiLevel() {
8787
}
8888

8989
@Test
90-
@Config(sdk = Build.VERSION_CODES.LOLLIPOP_MR1)
90+
@Config(sdk = Config.OLDEST_SDK)
9191
public void test_auto_atNotHighEnoughApiLevel() {
9292
ShadowPackageManager shadowPackageManager =
9393
shadowOf(ApplicationProvider.getApplicationContext().getPackageManager());
@@ -98,7 +98,7 @@ public void test_auto_atNotHighEnoughApiLevel() {
9898
app -> {
9999
UserAgentPublisher ua = app.get(UserAgentPublisher.class);
100100

101-
assertThat(ua.getUserAgent()).containsMatch(Pattern.compile("android-platform/($|\\s)"));
101+
assertThat(ua.getUserAgent()).containsMatch(Pattern.compile("android-installer/($|\\s)"));
102102
});
103103
}
104104

0 commit comments

Comments
 (0)