File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
src/androidTest/java/io/grpc/android/integrationtest Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ dependencies {
7676
7777 compileOnly libraries. javax_annotation
7878
79- androidTestImplementation ' androidx.test:rules :1.1.0-alpha1 '
80- androidTestImplementation ' androidx.test:runner:1.1.0-alpha1 '
79+ androidTestImplementation ' androidx.test.ext:junit :1.1.3 ' ,
80+ ' androidx.test:runner:1.4.0 '
8181}
8282
8383// Checkstyle doesn't run automatically with android
Original file line number Diff line number Diff line change 1616
1717package io .grpc .android .integrationtest ;
1818
19- import static junit . framework .Assert .assertEquals ;
19+ import static org . junit .Assert .assertEquals ;
2020
2121import android .util .Log ;
22- import androidx .test .InstrumentationRegistry ;
23- import androidx .test .runner .AndroidJUnit4 ;
22+ import androidx .test .core .app .ApplicationProvider ;
23+ import androidx .test .ext .junit .runners .AndroidJUnit4 ;
24+ import androidx .test .platform .app .InstrumentationRegistry ;
2425import com .google .android .gms .common .GooglePlayServicesNotAvailableException ;
2526import com .google .android .gms .common .GooglePlayServicesRepairableException ;
2627import com .google .android .gms .security .ProviderInstaller ;
@@ -59,7 +60,7 @@ public void setUp() throws Exception {
5960
6061 if (useTls ) {
6162 try {
62- ProviderInstaller .installIfNeeded (InstrumentationRegistry . getTargetContext ());
63+ ProviderInstaller .installIfNeeded (ApplicationProvider . getApplicationContext ());
6364 } catch (GooglePlayServicesRepairableException e ) {
6465 // The provider is helpful, but it is possible to succeed without it.
6566 // Hope that the system-provided libraries are new enough.
@@ -110,7 +111,7 @@ public void onComplete(String result) {
110111 };
111112 InputStream testCa ;
112113 if (useTestCa ) {
113- testCa = InstrumentationRegistry . getTargetContext ().getResources ().openRawResource (R .raw .ca );
114+ testCa = ApplicationProvider . getApplicationContext ().getResources ().openRawResource (R .raw .ca );
114115 } else {
115116 testCa = null ;
116117 }
You can’t perform that action at this time.
0 commit comments