use of org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeNotifier in project nifi-minifi by apache.
the class FileChangeIngestorTest method testTargetChangedWithModificationEvent_nonConfigFile.
@Test
public void testTargetChangedWithModificationEvent_nonConfigFile() throws Exception {
when(mockDifferentiator.isNew(Mockito.any(InputStream.class))).thenReturn(false);
final ConfigurationChangeNotifier testNotifier = Mockito.mock(ConfigurationChangeNotifier.class);
// In this case, we receive a trigger event for the directory monitored, but it was another file not being monitored
final WatchKey mockWatchKey = createMockWatchKeyForPath("footage_not_found.yml");
establishMockEnvironmentForChangeTests(testNotifier, mockWatchKey);
notifierSpy.targetChanged();
verify(testNotifier, Mockito.never()).notifyListeners(Mockito.any(ByteBuffer.class));
}
use of org.apache.nifi.minifi.bootstrap.configuration.ConfigurationChangeNotifier in project nifi-minifi by apache.
the class FileChangeIngestorTest method testTargetChangedNoModification.
/* Verify handleChange events */
@Test
public void testTargetChangedNoModification() throws Exception {
when(mockDifferentiator.isNew(Mockito.any(InputStream.class))).thenReturn(false);
final ConfigurationChangeNotifier testNotifier = Mockito.mock(ConfigurationChangeNotifier.class);
// In this case the WatchKey is null because there were no events found
establishMockEnvironmentForChangeTests(testNotifier, null);
verify(testNotifier, Mockito.never()).notifyListeners(Mockito.any(ByteBuffer.class));
}
Aggregations