Search in sources :

Example 1 with NakedProcessor

use of org.apache.nifi.documentation.example.NakedProcessor in project nifi by apache.

the class ProcessorDocumentationWriterTest method testNakedProcessor.

@Test
public void testNakedProcessor() throws IOException {
    NakedProcessor processor = new NakedProcessor();
    ProcessorInitializer initializer = new ProcessorInitializer();
    initializer.initialize(processor);
    DocumentationWriter writer = new HtmlProcessorDocumentationWriter();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    writer.write(processor, baos, false);
    initializer.teardown(processor);
    String results = new String(baos.toByteArray());
    XmlValidator.assertXmlValid(results);
    // no description
    assertContains(results, "No description provided.");
    // no tags
    assertContains(results, "No tags provided.");
    // properties
    assertContains(results, "This component has no required or optional properties.");
    // relationships
    assertContains(results, "This processor has no relationships.");
    // state management
    assertContains(results, "This component does not store state.");
    // state management
    assertContains(results, "This component is not restricted.");
    // input requirement
    assertNotContains(results, "Input requirement:");
}
Also used : ProcessorInitializer(org.apache.nifi.init.ProcessorInitializer) DocumentationWriter(org.apache.nifi.documentation.DocumentationWriter) ByteArrayOutputStream(java.io.ByteArrayOutputStream) NakedProcessor(org.apache.nifi.documentation.example.NakedProcessor) Test(org.junit.Test)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DocumentationWriter (org.apache.nifi.documentation.DocumentationWriter)1 NakedProcessor (org.apache.nifi.documentation.example.NakedProcessor)1 ProcessorInitializer (org.apache.nifi.init.ProcessorInitializer)1 Test (org.junit.Test)1