diff --git a/server/application-server/pom.xml b/server/application-server/pom.xml index d8a46c0a..62d5317c 100644 --- a/server/application-server/pom.xml +++ b/server/application-server/pom.xml @@ -1,13 +1,13 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-starter-parent 3.3.2 - + + de.tum.in.www1 hephaestus @@ -111,8 +111,29 @@ therapi-runtime-javadoc 0.15.0 + + org.springframework.modulith + spring-modulith-starter-core + + + org.springframework.modulith + spring-modulith-starter-test + test + + + + + org.springframework.modulith + spring-modulith-bom + 1.2.2 + import + pom + + + + diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/Application.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/Application.java index 80169ee1..0d39f321 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/Application.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/Application.java @@ -2,8 +2,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.modulith.Modulithic; @SpringBootApplication +@Modulithic(systemName = "Hephaestus") public class Application { public static void main(String[] args) { diff --git a/server/application-server/src/test/java/de/tum/in/www1/hephaestus/HephaestusApplicationTests.java b/server/application-server/src/test/java/de/tum/in/www1/hephaestus/HephaestusApplicationTests.java index 27780b84..5ac3f2bc 100644 --- a/server/application-server/src/test/java/de/tum/in/www1/hephaestus/HephaestusApplicationTests.java +++ b/server/application-server/src/test/java/de/tum/in/www1/hephaestus/HephaestusApplicationTests.java @@ -10,6 +10,8 @@ class HephaestusApplicationTests { @Test void contextLoads() { + // ContextLoads + assert (true); } } diff --git a/server/application-server/src/test/java/de/tum/in/www1/hephaestus/HephaestusModulithTests.java b/server/application-server/src/test/java/de/tum/in/www1/hephaestus/HephaestusModulithTests.java new file mode 100644 index 00000000..502b7367 --- /dev/null +++ b/server/application-server/src/test/java/de/tum/in/www1/hephaestus/HephaestusModulithTests.java @@ -0,0 +1,28 @@ +package de.tum.in.www1.hephaestus; + +import org.junit.jupiter.api.Test; +import org.springframework.modulith.core.ApplicationModules; +import org.springframework.modulith.docs.Documenter; +import org.springframework.modulith.docs.Documenter.DiagramOptions; +import org.springframework.modulith.docs.Documenter.DiagramOptions.DiagramStyle; + +public class HephaestusModulithTests { + + ApplicationModules modules = ApplicationModules.of(Application.class); + + @Test + void shouldBeCompliant() { + modules.forEach(System.out::println); + modules.verify(); + } + + @Test + void writeDocumentationSnippets() { + DiagramOptions options = DiagramOptions.defaults().withStyle(DiagramStyle.UML); + new Documenter(modules) + .writeModuleCanvases() + .writeModulesAsPlantUml(options) + .writeIndividualModulesAsPlantUml(options); + } + +}