From f0b0fff767243f584c327abbe916ae24b180522c Mon Sep 17 00:00:00 2001 From: Ryan McNally Date: Wed, 18 Jan 2023 15:24:49 +0000 Subject: [PATCH] Fixing mermaid orientation --- README.md | 2 +- .../mastercard/test/flow/doc/ModuleDiagramTest.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 90dc79105b..55df7ec190 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ These tests produce a rich execution report, [for example](https://mastercard.gi ```mermaid -graph LR +graph TB subgraph com.mastercard.test.flow api --> message-core api --> builder diff --git a/doc/src/test/java/com/mastercard/test/flow/doc/ModuleDiagramTest.java b/doc/src/test/java/com/mastercard/test/flow/doc/ModuleDiagramTest.java index 1b6f973281..f5a25f5cfe 100644 --- a/doc/src/test/java/com/mastercard/test/flow/doc/ModuleDiagramTest.java +++ b/doc/src/test/java/com/mastercard/test/flow/doc/ModuleDiagramTest.java @@ -62,7 +62,7 @@ class ModuleDiagramTest { void framework() throws Exception { Util.insert( Paths.get( "../README.md" ), "", - s -> diagram( false, "com.mastercard.test.flow" ), + s -> diagram( "TB", false, "com.mastercard.test.flow" ), "" ); } @@ -75,13 +75,13 @@ void framework() throws Exception { void example() throws Exception { Util.insert( Paths.get( "../example/README.md" ), "", - s -> diagram( true, + s -> diagram( "LR", true, "com.mastercard.test.flow", "com.mastercard.test.flow.example" ), "" ); } - private static String diagram( boolean intergroupLinks, String... groupIDs ) { + private static String diagram( String orientation, boolean intergroupLinks, String... groupIDs ) { PomData root = new PomData( null, Paths.get( "../pom.xml" ) ); Set artifacts = new HashSet<>(); @@ -105,7 +105,9 @@ private static String diagram( boolean intergroupLinks, String... groupIDs ) { pd.groupId(), pd.artifactId() ) ) ) ); - StringBuilder mermaid = new StringBuilder( "```mermaid\ngraph LR\n" ); + StringBuilder mermaid = new StringBuilder( "```mermaid\ngraph " ) + .append( orientation ) + .append( "\n" ); for( String groupID : groupIDs ) { mermaid.append( " subgraph " ).append( groupID ).append( "\n" );