Search in sources :

Example 1 with InvalidTable

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;
    }
}
Also used : InvalidTable(org.apache.hive.hcatalog.streaming.InvalidTable) HiveEndPoint(org.apache.hive.hcatalog.streaming.HiveEndPoint) Test(org.junit.Test)

Aggregations

HiveEndPoint (org.apache.hive.hcatalog.streaming.HiveEndPoint)1 InvalidTable (org.apache.hive.hcatalog.streaming.InvalidTable)1 Test (org.junit.Test)1