@Before public void setup() throws URISyntaxException { hiveDriver = new HiveDriver(delegate, null, true, jdbcUrlParser); testUrl = "testUrl"; when(jdbcUrlParser.parse(testUrl)).thenReturn(jdbcUrl); when(jdbcUrl.toString()).thenReturn(testUrl); }
@Test(expected = SQLException.class) public void testConnectFailParse() throws SQLException, URISyntaxException { String url = "fake-url"; when(jdbcUrlParser.parse(url)).thenThrow(new URISyntaxException("", "")); hiveDriver.connect(url, null); }
@Test public void testAcceptsUrlException() throws URISyntaxException, SQLException { String url = "fake-url"; when(jdbcUrlParser.parse(url)).thenThrow(new URISyntaxException("", "")); assertFalse(hiveDriver.acceptsURL(url)); }