use of com.android.org.conscrypt.SSLClientSessionCache in project android_frameworks_base by crdroidandroid.
the class SSLSessionCacheTest method testInstall_compatibleContext.
public void testInstall_compatibleContext() throws Exception {
final SSLContext ctx = SSLContext.getDefault();
final SSLClientSessionCache mock = LittleMock.mock(SSLClientSessionCache.class);
final ClientSessionContext clientCtx = (ClientSessionContext) ctx.getClientSessionContext();
try {
SSLSessionCache.install(new SSLSessionCache(mock), ctx);
clientCtx.getSession("www.foogle.com", 443);
LittleMock.verify(mock).getSessionData(LittleMock.anyString(), LittleMock.anyInt());
} finally {
// Restore cacheless behaviour.
SSLSessionCache.install(null, ctx);
clientCtx.getSession("www.foogle.com", 443);
LittleMock.verifyNoMoreInteractions(mock);
}
}
Aggregations