Search in sources :

Example 1 with HiveConfigurator

use of org.apache.nifi.util.hive.HiveConfigurator in project nifi by apache.

the class TestPutHiveStreaming method setUp.

@Before
public void setUp() throws Exception {
    // needed for calls to UserGroupInformation.setConfiguration() to work when passing in
    // config with Kerberos authentication enabled
    System.setProperty("java.security.krb5.realm", "nifi.com");
    System.setProperty("java.security.krb5.kdc", "nifi.kdc");
    ugi = null;
    kerberosPropsWithFile = new KerberosProperties(new File("src/test/resources/krb5.conf"));
    processor = new MockPutHiveStreaming();
    hiveConfigurator = mock(HiveConfigurator.class);
    hiveConf = mock(HiveConf.class);
    when(hiveConfigurator.getConfigurationFromFiles(anyString())).thenReturn(hiveConf);
    processor.hiveConfigurator = hiveConfigurator;
    processor.setKerberosProperties(kerberosPropsWithFile);
    runner = TestRunners.newTestRunner(processor);
}
Also used : HiveConfigurator(org.apache.nifi.util.hive.HiveConfigurator) HiveConf(org.apache.hadoop.hive.conf.HiveConf) MockFlowFile(org.apache.nifi.util.MockFlowFile) File(java.io.File) KerberosProperties(org.apache.nifi.hadoop.KerberosProperties) Before(org.junit.Before)

Aggregations

File (java.io.File)1 HiveConf (org.apache.hadoop.hive.conf.HiveConf)1 KerberosProperties (org.apache.nifi.hadoop.KerberosProperties)1 MockFlowFile (org.apache.nifi.util.MockFlowFile)1 HiveConfigurator (org.apache.nifi.util.hive.HiveConfigurator)1 Before (org.junit.Before)1