Streamline testInstall_compatibleContext()

Conscrypt is making ClientSessionContext#getSession() private since
users shouldn't be calling it, which causes this test to fail to build.
While this test uses it, in practice the only non-Conscrypt code it's
testing is SSLSessionCache#install(), the rest of it just tests that
Conscrypt works properly.  We reduce the test to just a test of the
SSLSessionCache code, since Conscrypt's tests should suffice for testing
Conscrypt's use of the cache.

Test: adb shell am instrument -w -e class android.net.SSLSessionCacheTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: Iea61c47eb2c002629dd2f50c81d5bc4f7221c654
This commit is contained in:
Adam Vartanian
2017-07-06 15:43:52 +01:00
parent b171a46d19
commit 7b2c66b678

View File

@@ -44,12 +44,9 @@ public class SSLSessionCacheTest extends TestCase {
try {
SSLSessionCache.install(new SSLSessionCache(mock), ctx);
clientCtx.getSession("www.foogle.com", 443);
Mockito.verify(mock).getSessionData(Mockito.anyString(), Mockito.anyInt());
} finally {
// Restore cacheless behaviour.
SSLSessionCache.install(null, ctx);
clientCtx.getSession("www.foogle.com", 443);
Mockito.verifyNoMoreInteractions(mock);
}
}