Skip to content

Commit 43491db

Browse files
authored
[Storage] Replace hardcoded SDK version with Config.OLDEST_SDK (#7034)
Tests will use the Config.OLDEST_SDK instead of a hardcoded SDK if the corresponding hardcoded SDK would be below our inteded minSdk. As a pending work is re-evaluate whether these tests are necessary to keep around, or if they are irrelevant when bumping the minSdk. Related to cl/769913191
1 parent 9b510c4 commit 43491db

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

firebase-storage/src/test/java/com/google/firebase/storage/AdaptiveStreamBufferTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import static org.junit.Assert.assertArrayEquals;
1818

19-
import android.os.Build;
2019
import com.google.firebase.storage.internal.AdaptiveStreamBuffer;
2120
import java.io.ByteArrayInputStream;
2221
import java.io.IOException;
@@ -30,7 +29,7 @@
3029

3130
/** Tests for {@link AdaptiveStreamBuffer}. */
3231
@RunWith(RobolectricTestRunner.class)
33-
@Config(sdk = Build.VERSION_CODES.LOLLIPOP_MR1)
32+
@Config(sdk = Config.OLDEST_SDK)
3433
public class AdaptiveStreamBufferTest {
3534

3635
@Rule public RetryRule retryRule = new RetryRule(3);

firebase-storage/src/test/java/com/google/firebase/storage/DependencyTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package com.google.firebase.storage;
1616

17-
import android.os.Build;
1817
import com.google.android.gms.tasks.Task;
1918
import java.lang.reflect.Method;
2019
import java.util.ArrayList;
@@ -29,7 +28,7 @@
2928

3029
/** Tests for {@link FirebaseStorage}. */
3130
@RunWith(RobolectricTestRunner.class)
32-
@Config(sdk = Build.VERSION_CODES.LOLLIPOP_MR1)
31+
@Config(sdk = Config.OLDEST_SDK)
3332
public class DependencyTest {
3433

3534
@Rule public RetryRule retryRule = new RetryRule(3);

firebase-storage/src/test/java/com/google/firebase/storage/StorageReferenceTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import static com.google.firebase.common.testutil.Assert.assertThrows;
1818

19-
import android.os.Build;
2019
import androidx.test.core.app.ApplicationProvider;
2120
import com.google.android.gms.tasks.Task;
2221
import com.google.firebase.FirebaseApp;
@@ -38,7 +37,7 @@
3837

3938
/** Tests for {@link FirebaseStorage}. */
4039
@RunWith(RobolectricTestRunner.class)
41-
@Config(sdk = Build.VERSION_CODES.LOLLIPOP_MR1)
40+
@Config(sdk = Config.OLDEST_SDK)
4241
public class StorageReferenceTest {
4342

4443
@Rule public RetryRule retryRule = new RetryRule(3);

firebase-storage/src/test/java/com/google/firebase/storage/StreamProgressWrapperTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import static com.google.firebase.common.testutil.Assert.assertThrows;
1818

19-
import android.os.Build;
2019
import com.google.firebase.storage.StreamDownloadTask.StreamProgressWrapper;
2120
import com.google.firebase.storage.network.MockInputStreamHelper;
2221
import java.io.ByteArrayInputStream;
@@ -35,7 +34,7 @@
3534

3635
/** Tests for {@link StreamProgressWrapper}. */
3736
@RunWith(RobolectricTestRunner.class)
38-
@Config(sdk = Build.VERSION_CODES.LOLLIPOP_MR1)
37+
@Config(sdk = Config.OLDEST_SDK)
3938
@SuppressWarnings("ResultOfMethodCallIgnored")
4039
public class StreamProgressWrapperTest {
4140

0 commit comments

Comments
 (0)