### Question:
PhoenixDriver extends PhoenixEmbeddedDriver { @Override public Connection connect(String url, Properties info) throws SQLException { if (!acceptsURL(url)) { return null; } try { lockInterruptibly(LockMode.READ); checkClosed(); return createConnection(url, info); } finally { unlock(LockMode.READ); } } PhoenixDriver(); @Override QueryServices getQueryServices(); @Override boolean acceptsURL(String url); @Override Connection connect(String url, Properties info); @Override synchronized void close(); static final PhoenixDriver INSTANCE; }### Answer:
@Test public void testFirstConnectionWhenPropsHasTenantId() throws Exception { Properties props = new Properties(); final String tenantId = "00Dxx0000001234"; props.put(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); Connection connection = new PhoenixTestDriver().connect(getUrl(), props); assertEquals(tenantId, connection.getClientInfo(PhoenixRuntime.TENANT_ID_ATTRIB)); }
@Test public void testFirstConnectionWhenUrlHasTenantId() throws Exception { final String tenantId = "00Dxx0000001234"; String url = getUrl() + ";" + PhoenixRuntime.TENANT_ID_ATTRIB + "=" + tenantId; Driver driver = new PhoenixTestDriver(); driver.connect(url, new Properties()); }