Search in sources :

Example 1 with ExtensionDocumentationResourceGenerator

use of org.mule.runtime.module.extension.internal.resources.documentation.ExtensionDocumentationResourceGenerator in project mule by mulesoft.

the class ExtensionDescriptionDocumenterTestCase method persistDocumentation.

@Test
public void persistDocumentation() throws Exception {
    InputStream in = getClass().getResourceAsStream(expectedProductPath);
    assertThat(in, is(notNullValue()));
    String expectedXml = IOUtils.toString(in);
    TestProcessor processor = new TestProcessor(extensionClass);
    doCompile(processor);
    ExtensionDocumentationResourceGenerator generator = new ExtensionDocumentationResourceGenerator();
    GeneratedResource resource = generator.generateResource(processor.getExtensionModel()).orElseThrow(() -> new RuntimeException("No Documentation Generated"));
    compareXML(expectedXml, new String(resource.getContent()));
}
Also used : ExtensionDocumentationResourceGenerator(org.mule.runtime.module.extension.internal.resources.documentation.ExtensionDocumentationResourceGenerator) InputStream(java.io.InputStream) GeneratedResource(org.mule.runtime.extension.api.resources.GeneratedResource) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

InputStream (java.io.InputStream)1 Test (org.junit.Test)1 GeneratedResource (org.mule.runtime.extension.api.resources.GeneratedResource)1 ExtensionDocumentationResourceGenerator (org.mule.runtime.module.extension.internal.resources.documentation.ExtensionDocumentationResourceGenerator)1 SmallTest (org.mule.tck.size.SmallTest)1