Skip to content

Commit 558d5e1

Browse files
flowable processes doc maven plugin
1 parent b470a54 commit 558d5e1

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

maven-plugins/flowable-bpmn-docs-maven-plugin/src/main/java/org/eclipse/dirigible/flowable/bpmn/docs/export/PdfExporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static void export(File mdFile, File outDir, String fileName) throws IOEx
7373

7474
try (OutputStream os = new FileOutputStream(pdfFile)) {
7575
PdfRendererBuilder builder = new PdfRendererBuilder();
76-
76+
7777
String baseDocumentUri = mdFile.getParentFile()
7878
.toURI()
7979
.toString();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.eclipse.dirigible.flowable.bpmn.docs.mojo;
2+
3+
import org.apache.maven.plugin.MojoExecutionException;
4+
import org.junit.jupiter.api.Test;
5+
6+
import java.io.File;
7+
import java.net.URISyntaxException;
8+
import java.net.URL;
9+
10+
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
11+
12+
class GenerateDocsMojoTest {
13+
14+
@Test
15+
void execute() throws MojoExecutionException, URISyntaxException {
16+
URL resource = getClass().getClassLoader()
17+
.getResource(".");
18+
File resourceFolder = new File(resource.toURI());
19+
20+
File bpmnDirectory = resourceFolder;
21+
File outputDirectory = resourceFolder;
22+
String geminiApiKey = ""; // not configured
23+
24+
GenerateDocsMojo mojo = new GenerateDocsMojo(bpmnDirectory, outputDirectory, geminiApiKey);
25+
26+
mojo.execute();
27+
28+
assertResourceFileGenerated("loan-payoff-generated.md");
29+
assertResourceFileGenerated("loan-payoff-generated.pdf");
30+
}
31+
32+
private void assertResourceFileGenerated(String fileName) throws URISyntaxException {
33+
URL resource = getClass().getClassLoader()
34+
.getResource(fileName);
35+
assertThat(resource).describedAs("Missing resource " + fileName)
36+
.isNotNull();
37+
38+
File resourceFile = new File(resource.toURI());
39+
assertThat(resourceFile).exists();
40+
}
41+
}

0 commit comments

Comments
 (0)