use of org.apache.nifi.mock.MockReportingInitializationContext in project nifi by apache.
the class ReportingTaskingInitializer method initialize.
@Override
public void initialize(ConfigurableComponent component) throws InitializationException {
ReportingTask reportingTask = (ReportingTask) component;
ReportingInitializationContext context = new MockReportingInitializationContext();
try (NarCloseable narCloseable = NarCloseable.withComponentNarLoader(component.getClass(), context.getIdentifier())) {
reportingTask.initialize(context);
}
}
use of org.apache.nifi.mock.MockReportingInitializationContext in project nifi by apache.
the class HtmlDocumentationWriterTest method testReportingTaskWithLogger.
@Test
public void testReportingTaskWithLogger() throws InitializationException, IOException {
ReportingTask controllerService = new ReportingTaskWithLogger();
controllerService.initialize(new MockReportingInitializationContext());
DocumentationWriter writer = new HtmlDocumentationWriter();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
writer.write(controllerService, baos, false);
String results = new String(baos.toByteArray());
XmlValidator.assertXmlValid(results);
}
use of org.apache.nifi.mock.MockReportingInitializationContext in project nifi-minifi by apache.
the class ReportingTaskingInitializer method initialize.
@Override
public void initialize(ConfigurableComponent component) throws InitializationException {
ReportingTask reportingTask = (ReportingTask) component;
ReportingInitializationContext context = new MockReportingInitializationContext();
try (NarCloseable narCloseable = NarCloseable.withComponentNarLoader(component.getClass(), context.getIdentifier())) {
reportingTask.initialize(context);
}
}
Aggregations