use of org.apache.nifi.hadoop.KerberosProperties in project nifi by apache.
the class TestHBase_1_1_2_ClientMapCacheService method setup.
@Before
public void setup() {
// 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");
kerberosPropsWithFile = new KerberosProperties(new File("src/test/resources/krb5.conf"));
kerberosPropsWithoutFile = new KerberosProperties(null);
}
use of org.apache.nifi.hadoop.KerberosProperties in project nifi by apache.
the class TestHBase_1_1_2_RecordLookupService method before.
@Before
public void before() throws Exception {
testLookupProcessor = new TestRecordLookupProcessor();
runner = TestRunners.newTestRunner(testLookupProcessor);
// setup mock HBaseClientService
final Table table = Mockito.mock(Table.class);
when(table.getName()).thenReturn(TableName.valueOf(TABLE_NAME));
final KerberosProperties kerberosProperties = new KerberosProperties(new File("src/test/resources/krb5.conf"));
clientService = new MockHBaseClientService(table, "family", kerberosProperties);
runner.addControllerService("clientService", clientService);
runner.setProperty(clientService, HBase_1_1_2_ClientService.HADOOP_CONF_FILES, "src/test/resources/hbase-site.xml");
runner.enableControllerService(clientService);
// setup HBase LookupService
lookupService = new HBase_1_1_2_RecordLookupService();
runner.addControllerService("lookupService", lookupService);
runner.setProperty(lookupService, HBase_1_1_2_RecordLookupService.HBASE_CLIENT_SERVICE, "clientService");
runner.setProperty(lookupService, HBase_1_1_2_RecordLookupService.TABLE_NAME, TABLE_NAME);
runner.enableControllerService(lookupService);
// setup test processor
runner.setProperty(TestRecordLookupProcessor.HBASE_LOOKUP_SERVICE, "lookupService");
runner.setProperty(TestRecordLookupProcessor.HBASE_ROW, ROW);
}
use of org.apache.nifi.hadoop.KerberosProperties in project nifi by apache.
the class AbstractHadoopTest method testKerberosOptionsWithBadKerberosConfigFile.
@Test
public void testKerberosOptionsWithBadKerberosConfigFile() throws Exception {
// invalid since the kerberos configuration was changed to a non-existent file
kerberosProperties = new KerberosProperties(new File("BAD_KERBEROS_PATH"));
SimpleHadoopProcessor processor = new SimpleHadoopProcessor(kerberosProperties);
TestRunner runner = TestRunners.newTestRunner(processor);
runner.assertValid();
runner.setProperty(AbstractHadoopProcessor.HADOOP_CONFIGURATION_RESOURCES, "src/test/resources/core-site-security.xml");
runner.setProperty(kerberosProperties.getKerberosPrincipal(), "principal");
runner.setProperty(kerberosProperties.getKerberosKeytab(), temporaryFile.getAbsolutePath());
runner.assertNotValid();
}
use of org.apache.nifi.hadoop.KerberosProperties in project nifi by apache.
the class GetHDFSTest method setup.
@Before
public void setup() {
mockNiFiProperties = mock(NiFiProperties.class);
when(mockNiFiProperties.getKerberosConfigurationFile()).thenReturn(null);
kerberosProperties = new KerberosProperties(null);
}
use of org.apache.nifi.hadoop.KerberosProperties in project nifi by apache.
the class TestCreateHadoopSequenceFile method setUp.
@Before
public void setUp() {
mockNiFiProperties = mock(NiFiProperties.class);
when(mockNiFiProperties.getKerberosConfigurationFile()).thenReturn(null);
kerberosProperties = new KerberosProperties(null);
CreateHadoopSequenceFile proc = new TestableCreateHadoopSequenceFile(kerberosProperties);
controller = TestRunners.newTestRunner(proc);
}
Aggregations