mirror of https://github.com/apache/nifi.git
NIFI-735: removing call to OnRemoved and updating unit tests
This commit is contained in:
parent
93546760be
commit
c769742d9b
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.nifi.documentation.init;
|
||||
|
||||
import org.apache.nifi.annotation.lifecycle.OnRemoved;
|
||||
import org.apache.nifi.annotation.lifecycle.OnShutdown;
|
||||
import org.apache.nifi.components.ConfigurableComponent;
|
||||
import org.apache.nifi.controller.ControllerService;
|
||||
|
@ -52,7 +51,6 @@ public class ControllerServiceInitializer implements ConfigurableComponentInitia
|
|||
|
||||
final ProcessorLog logger = new MockProcessorLogger();
|
||||
final MockConfigurationContext context = new MockConfigurationContext();
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnRemoved.class, org.apache.nifi.processor.annotation.OnRemoved.class, controllerService, logger, context);
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnShutdown.class, org.apache.nifi.processor.annotation.OnShutdown.class, controllerService, logger, context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.nifi.documentation.init;
|
||||
|
||||
import org.apache.nifi.annotation.lifecycle.OnRemoved;
|
||||
import org.apache.nifi.annotation.lifecycle.OnShutdown;
|
||||
import org.apache.nifi.components.ConfigurableComponent;
|
||||
import org.apache.nifi.documentation.ConfigurableComponentInitializer;
|
||||
|
@ -50,7 +49,6 @@ public class ProcessorInitializer implements ConfigurableComponentInitializer {
|
|||
|
||||
final ProcessorLog logger = new MockProcessorLogger();
|
||||
final MockProcessContext context = new MockProcessContext();
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnRemoved.class, org.apache.nifi.processor.annotation.OnRemoved.class, processor, logger, context);
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnShutdown.class, org.apache.nifi.processor.annotation.OnShutdown.class, processor, logger, context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.nifi.documentation.init;
|
||||
|
||||
import org.apache.nifi.annotation.lifecycle.OnRemoved;
|
||||
import org.apache.nifi.annotation.lifecycle.OnShutdown;
|
||||
import org.apache.nifi.components.ConfigurableComponent;
|
||||
import org.apache.nifi.documentation.ConfigurableComponentInitializer;
|
||||
|
@ -49,7 +48,6 @@ public class ReportingTaskingInitializer implements ConfigurableComponentInitial
|
|||
try (NarCloseable narCloseable = NarCloseable.withNarLoader()) {
|
||||
|
||||
final MockConfigurationContext context = new MockConfigurationContext();
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnRemoved.class, org.apache.nifi.processor.annotation.OnRemoved.class, reportingTask, new MockProcessorLogger(), context);
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnShutdown.class, org.apache.nifi.processor.annotation.OnShutdown.class, reportingTask, new MockProcessorLogger(), context);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ public class HtmlDocumentationWriterTest {
|
|||
assertContains(results, "Sensitive Property: true");
|
||||
|
||||
// verify the right OnRemoved and OnShutdown methods were called
|
||||
Assert.assertEquals(1, controllerService.getOnRemovedArgs());
|
||||
Assert.assertEquals(1, controllerService.getOnRemovedNoArgs());
|
||||
Assert.assertEquals(0, controllerService.getOnRemovedArgs());
|
||||
Assert.assertEquals(0, controllerService.getOnRemovedNoArgs());
|
||||
|
||||
Assert.assertEquals(1, controllerService.getOnShutdownArgs());
|
||||
Assert.assertEquals(1, controllerService.getOnShutdownNoArgs());
|
||||
|
@ -115,8 +115,8 @@ public class HtmlDocumentationWriterTest {
|
|||
assertContains(results, "false");
|
||||
|
||||
// verify the right OnRemoved and OnShutdown methods were called
|
||||
Assert.assertEquals(1, reportingTask.getOnRemovedArgs());
|
||||
Assert.assertEquals(1, reportingTask.getOnRemovedNoArgs());
|
||||
Assert.assertEquals(0, reportingTask.getOnRemovedArgs());
|
||||
Assert.assertEquals(0, reportingTask.getOnRemovedNoArgs());
|
||||
|
||||
Assert.assertEquals(1, reportingTask.getOnShutdownArgs());
|
||||
Assert.assertEquals(1, reportingTask.getOnShutdownNoArgs());
|
||||
|
|
|
@ -75,8 +75,8 @@ public class ProcessorDocumentationWriterTest {
|
|||
assertNotContains(results, "Additional Details...");
|
||||
|
||||
// verify the right OnRemoved and OnShutdown methods were called
|
||||
Assert.assertEquals(1, processor.getOnRemovedArgs());
|
||||
Assert.assertEquals(1, processor.getOnRemovedNoArgs());
|
||||
Assert.assertEquals(0, processor.getOnRemovedArgs());
|
||||
Assert.assertEquals(0, processor.getOnRemovedNoArgs());
|
||||
|
||||
Assert.assertEquals(1, processor.getOnShutdownArgs());
|
||||
Assert.assertEquals(1, processor.getOnShutdownNoArgs());
|
||||
|
|
Loading…
Reference in New Issue