Skip to content

Commit

Permalink
Update to the latest sdk version (#167)
Browse files Browse the repository at this point in the history
And make sure version-specific tests are running on more versions
  • Loading branch information
jkwatson authored Oct 5, 2021
1 parent 77a81c8 commit 8e4e634
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions splunk-otel-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
}

android {
compileSdkVersion 30
compileSdkVersion 31
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
import java.util.concurrent.atomic.AtomicInteger;

@RunWith(RobolectricTestRunner.class)
@Config(maxSdk = Build.VERSION_CODES.S)
public class ConnectionUtilTest {

@Test
@Config(sdk = Build.VERSION_CODES.LOLLIPOP)
@Config(maxSdk = Build.VERSION_CODES.LOLLIPOP)
public void lollipop() {
NetworkRequest networkRequest = mock(NetworkRequest.class);
NetworkDetector networkDetector = mock(NetworkDetector.class);
Expand Down Expand Up @@ -85,8 +86,8 @@ public void lollipop() {
}

@Test
@Config(sdk = Build.VERSION_CODES.Q)
public void quiznos() {
@Config(maxSdk = Build.VERSION_CODES.S, minSdk = Build.VERSION_CODES.O)
public void modernSdks() {
NetworkRequest networkRequest = mock(NetworkRequest.class);
NetworkDetector networkDetector = mock(NetworkDetector.class);
ConnectivityManager connectivityManager = mock(ConnectivityManager.class);
Expand Down Expand Up @@ -133,7 +134,7 @@ public void networkDetectorException() {
}

@Test
@Config(sdk = Build.VERSION_CODES.Q)
@Config(maxSdk = Build.VERSION_CODES.S, minSdk = Build.VERSION_CODES.O)
public void networkDetectorExceptionOnCallbackRegistration() {
NetworkDetector networkDetector = mock(NetworkDetector.class);
ConnectivityManager connectivityManager = mock(ConnectivityManager.class);
Expand All @@ -148,7 +149,7 @@ public void networkDetectorExceptionOnCallbackRegistration() {
}

@Test
@Config(sdk = Build.VERSION_CODES.LOLLIPOP)
@Config(maxSdk = Build.VERSION_CODES.LOLLIPOP)
public void networkDetectorExceptionOnCallbackRegistration_lollipop() {
NetworkDetector networkDetector = mock(NetworkDetector.class);
ConnectivityManager connectivityManager = mock(ConnectivityManager.class);
Expand All @@ -164,7 +165,7 @@ public void networkDetectorExceptionOnCallbackRegistration_lollipop() {
}

@Test
@Config(sdk = Build.VERSION_CODES.LOLLIPOP)
@Config(maxSdk = Build.VERSION_CODES.LOLLIPOP)
public void shouldNotFailOnImmediateConnectionManagerCall_lollipop() {
NetworkRequest networkRequest = mock(NetworkRequest.class);
NetworkDetector networkDetector = mock(NetworkDetector.class);
Expand All @@ -182,8 +183,8 @@ public void shouldNotFailOnImmediateConnectionManagerCall_lollipop() {
}

@Test
@Config(sdk = Build.VERSION_CODES.Q)
public void shouldNotFailOnImmediateConnectionManagerCall_quiznos() {
@Config(maxSdk = Build.VERSION_CODES.S, minSdk = Build.VERSION_CODES.O)
public void shouldNotFailOnImmediateConnectionManagerCall() {
NetworkRequest networkRequest = mock(NetworkRequest.class);
NetworkDetector networkDetector = mock(NetworkDetector.class);
ConnectivityManager connectivityManager = mock(ConnectivityManager.class);
Expand Down

0 comments on commit 8e4e634

Please sign in to comment.