use of org.apache.hive.hcatalog.streaming.InvalidTable in project nifi by apache.
the class HiveWriterTest method testNewConnectionInvalidTable.
@Test(expected = HiveWriter.ConnectFailure.class)
public void testNewConnectionInvalidTable() throws Exception {
hiveEndPoint = mock(HiveEndPoint.class);
InvalidTable invalidTable = new InvalidTable("badDb", "badTable");
when(hiveEndPoint.newConnection(autoCreatePartitions, hiveConf, userGroupInformation)).thenThrow(invalidTable);
try {
initWriter();
} catch (HiveWriter.ConnectFailure e) {
assertEquals(invalidTable, e.getCause());
throw e;
}
}
Aggregations