use of org.apache.nifi.processors.hadoop.util.SequenceFileReader in project nifi by apache.
the class GetHDFSSequenceFileTest method testGetFlowFilesNoUgiShouldntCallDoAs.
@Test
public void testGetFlowFilesNoUgiShouldntCallDoAs() throws Exception {
hdfsResources = new AbstractHadoopProcessor.HdfsResources(configuration, fileSystem, null);
init();
SequenceFileReader reader = mock(SequenceFileReader.class);
Path file = mock(Path.class);
getHDFSSequenceFile.getFlowFiles(configuration, fileSystem, reader, file);
verify(reader).readSequenceFile(file, configuration, fileSystem);
}
use of org.apache.nifi.processors.hadoop.util.SequenceFileReader in project nifi by apache.
the class GetHDFSSequenceFileTest method getFlowFilesWithUgiAndNewTicketShouldCallDoAsAndNotRelogin.
@Test
public void getFlowFilesWithUgiAndNewTicketShouldCallDoAsAndNotRelogin() throws Exception {
SequenceFileReader reader = mock(SequenceFileReader.class);
Path file = mock(Path.class);
getHDFSSequenceFile.getFlowFiles(configuration, fileSystem, reader, file);
ArgumentCaptor<PrivilegedExceptionAction> privilegedExceptionActionArgumentCaptor = ArgumentCaptor.forClass(PrivilegedExceptionAction.class);
verifyNoMoreInteractions(reader);
verify(userGroupInformation).doAs(privilegedExceptionActionArgumentCaptor.capture());
privilegedExceptionActionArgumentCaptor.getValue().run();
verify(reader).readSequenceFile(file, configuration, fileSystem);
assertFalse(reloginTried);
}
Aggregations