use of org.kie.workbench.common.stunner.core.documentation.model.HTMLDocumentationTemplate in project kie-wb-common by kiegroup.
the class DMNDocumentationServiceImplTest method testBuildDocumentation.
@Test
public void testBuildDocumentation() {
final HTMLDocumentationTemplate template = mock(HTMLDocumentationTemplate.class);
final DMNDocumentation documentation = mock(DMNDocumentation.class);
final String documentationTemplate = "documentationTemplate";
final String rendered = "<template rendered='true' />";
final DocumentationOutput expectedOutput = new DocumentationOutput(rendered);
when(template.getTemplate()).thenReturn(documentationTemplate);
when(mustacheTemplateRenderer.render(documentationTemplate, documentation)).thenReturn(rendered);
final DocumentationOutput actualOutput = service.buildDocumentation(template, documentation);
assertEquals(expectedOutput.getValue(), actualOutput.getValue());
}
use of org.kie.workbench.common.stunner.core.documentation.model.HTMLDocumentationTemplate in project kie-wb-common by kiegroup.
the class DMNDocumentationServiceImplTest method testGetDocumentationTemplate.
@Test
public void testGetDocumentationTemplate() {
final HTMLDocumentationTemplate documentationTemplate = service.getDocumentationTemplate();
final String expectedTemplate = "documentationTemplate";
final String actualTemplate = documentationTemplate.getTemplate();
assertEquals(expectedTemplate, actualTemplate);
}
use of org.kie.workbench.common.stunner.core.documentation.model.HTMLDocumentationTemplate in project kie-wb-common by kiegroup.
the class DMNDocumentationServiceImplTest method testGenerateWhenDiagramIsPresent.
@Test
public void testGenerateWhenDiagramIsPresent() {
final HTMLDocumentationTemplate template = mock(HTMLDocumentationTemplate.class);
final DMNDocumentation documentation = mock(DMNDocumentation.class);
final DocumentationOutput expectedOutput = mock(DocumentationOutput.class);
doReturn(template).when(service).getDocumentationTemplate();
doReturn(documentation).when(service).processDocumentation(diagram);
doReturn(expectedOutput).when(service).buildDocumentation(template, documentation);
final DocumentationOutput actualOutput = service.generate(diagram);
assertEquals(expectedOutput, actualOutput);
}
use of org.kie.workbench.common.stunner.core.documentation.model.HTMLDocumentationTemplate in project kie-wb-common by kiegroup.
the class ClientBPMNDocumentationServiceTest method buildDocumentation.
@Test
public void buildDocumentation() {
final HTMLDocumentationTemplate documentationTemplate = tested.getDocumentationTemplate();
final BPMNDocumentation bpmnDocumentation = tested.processDocumentation(diagram);
final DocumentationOutput documentationOutput = tested.buildDocumentation(documentationTemplate, bpmnDocumentation);
assertEquals(RENDERED_DOC, documentationOutput.getValue());
}
use of org.kie.workbench.common.stunner.core.documentation.model.HTMLDocumentationTemplate in project kie-wb-common by kiegroup.
the class ClientBPMNDocumentationServiceTest method getDocumentationTemplate.
@Test
public void getDocumentationTemplate() {
final HTMLDocumentationTemplate documentationTemplate = tested.getDocumentationTemplate();
assertEquals(TEMPLATE, documentationTemplate.getTemplate());
}
Aggregations