Code example for URI

Methods: getAuthority

0
        } catch (URISyntaxException expected) {
        } 
    } 
 
    public void testAtSignInUserInfo() throws Exception { 
        URI uri = new URI("http://user@userhost.com:password@host");
        assertEquals("user@userhost.com:password@host", uri.getAuthority());
        assertEquals(null, uri.getUserInfo());
        assertEquals(null, uri.getHost());
    } 
 
    public void testUserNoPassword() throws Exception { 
        URI uri = new URI("http://user@host");
        assertEquals("user@host", uri.getAuthority());
        assertEquals("user", uri.getUserInfo());
        assertEquals("host", uri.getHost());
    } 
 
    public void testUserNoPasswordExplicitPort() throws Exception { 
        URI uri = new URI("http://user@host:8080");
Contextual code suggestions in your IDE  Get Codota for Java