Package org.apache.http.conn

Examples of org.apache.http.conn.SchemePortResolver.resolve()


    @Test
    public void testGetKeyWithSchemeRegistry() throws Exception {
        final SchemePortResolver schemePortResolver = Mockito.mock(SchemePortResolver.class);
        final BasicAuthCache cache = new BasicAuthCache(schemePortResolver);
        Mockito.when(schemePortResolver.resolve(new HttpHost("localhost", -1, "https"))).thenReturn(443);
        final HttpHost target = new HttpHost("localhost", 443, "https");
        Assert.assertSame(target, cache.getKey(target));
        Assert.assertEquals(target, cache.getKey(new HttpHost("localhost", -1, "https")));
    }
View Full Code Here


    @Test
    public void testGetKeyWithSchemeRegistry() throws Exception {
        final SchemePortResolver schemePortResolver = Mockito.mock(SchemePortResolver.class);
        final BasicAuthCache cache = new BasicAuthCache(schemePortResolver);
        Mockito.when(schemePortResolver.resolve(new HttpHost("localhost", -1, "https"))).thenReturn(443);
        final HttpHost target = new HttpHost("localhost", 443, "https");
        Assert.assertSame(target, cache.getKey(target));
        Assert.assertEquals(target, cache.getKey(new HttpHost("localhost", -1, "https")));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.