### Question:
PrestoDriverUri { public Properties getProperties() { return properties; } PrestoDriverUri(String url, Properties driverProperties); private  PrestoDriverUri(URI uri, Properties driverProperties); URI getJdbcUri(); String getSchema(); String getCatalog(); URI getHttpUri(); String getUser(); Map<String, ClientSelectedRole> getRoles(); Optional<String> getApplicationNamePrefix(); Properties getProperties(); Map<String, String> getExtraCredentials(); Optional<String> getClientInfo(); Optional<String> getClientTags(); Optional<String> getTraceToken(); Optional<Boolean> useSessionTimezone(); Map<String, String> getSessionProperties(); void setupClient(OkHttpClient.Builder builder);  }### Answer:
@Test public void testEmptyPassword() throws SQLException { PrestoDriverUri parameters = createDriverUri("presto: assertEquals(parameters.getProperties().getProperty("password"), ""); }
@Test public void testNonEmptyPassword() throws SQLException { PrestoDriverUri parameters = createDriverUri("presto: assertEquals(parameters.getProperties().getProperty("password"), "secret"); }
@Test public void testUriWithSocksProxy() throws SQLException { PrestoDriverUri parameters = createDriverUri("presto: assertUriPortScheme(parameters, 8080, "http"); Properties properties = parameters.getProperties(); assertEquals(properties.getProperty(SOCKS_PROXY.getKey()), "localhost:1234"); }
@Test public void testUriWithHttpProxy() throws SQLException { PrestoDriverUri parameters = createDriverUri("presto: assertUriPortScheme(parameters, 8080, "http"); Properties properties = parameters.getProperties(); assertEquals(properties.getProperty(HTTP_PROXY.getKey()), "localhost:5678"); }
@Test public void testUriWithSslEnabled() throws SQLException { PrestoDriverUri parameters = createDriverUri("presto: assertUriPortScheme(parameters, 8080, "https"); Properties properties = parameters.getProperties(); assertNull(properties.getProperty(SSL_TRUST_STORE_PATH.getKey())); assertNull(properties.getProperty(SSL_TRUST_STORE_PASSWORD.getKey())); }
@Test public void testUriWithSslEnabledPathOnly() throws SQLException { PrestoDriverUri parameters = createDriverUri("presto: assertUriPortScheme(parameters, 8080, "https"); Properties properties = parameters.getProperties(); assertEquals(properties.getProperty(SSL_TRUST_STORE_PATH.getKey()), "truststore.jks"); assertNull(properties.getProperty(SSL_TRUST_STORE_PASSWORD.getKey())); }
@Test public void testUriWithSslEnabledPassword() throws SQLException { PrestoDriverUri parameters = createDriverUri("presto: assertUriPortScheme(parameters, 8080, "https"); Properties properties = parameters.getProperties(); assertEquals(properties.getProperty(SSL_TRUST_STORE_PATH.getKey()), "truststore.jks"); assertEquals(properties.getProperty(SSL_TRUST_STORE_PASSWORD.getKey()), "password"); }
@Test public void testUriWithExtraCredentials() throws SQLException { String extraCredentials = "test.token.foo:bar;test.token.abc:xyz"; PrestoDriverUri parameters = createDriverUri("presto: Properties properties = parameters.getProperties(); assertEquals(properties.getProperty(EXTRA_CREDENTIALS.getKey()), extraCredentials); }
@Test public void testUriWithClientTags() throws SQLException { String clientTags = "c1,c2"; PrestoDriverUri parameters = createDriverUri("presto: Properties properties = parameters.getProperties(); assertEquals(properties.getProperty(CLIENT_TAGS.getKey()), clientTags); }