diff --git a/config-server/src/main/java/com/xtrmetl/config/ConfigServerApplication.java b/config-server/src/main/java/com/xtrmetl/config/ConfigServerApplication.java index 00f2e187..6e7ff057 100644 --- a/config-server/src/main/java/com/xtrmetl/config/ConfigServerApplication.java +++ b/config-server/src/main/java/com/xtrmetl/config/ConfigServerApplication.java @@ -4,9 +4,23 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.config.server.EnableConfigServer; +/** + * Starts the standalone mightyETL Config Server. + * + *

This bootstrap owns only starting the Spring Cloud Config server. Deployment-owned Git + * repository selection is a separate authority hardened by #179/#189, and inbound client + * authentication remains the separate security decision tracked by #193. The existence of this + * module does not by itself make Config Server a required/default mightyETL deployment service.

+ */ @SpringBootApplication @EnableConfigServer public class ConfigServerApplication { + + /** + * Launches the Config Server through Spring Boot. + * + * @param args command-line arguments passed to Spring Boot + */ public static void main(String[] args) { SpringApplication.run(ConfigServerApplication.class, args); } diff --git a/config-server/src/test/java/com/xtrmetl/config/ConfigServerApplicationContractTest.java b/config-server/src/test/java/com/xtrmetl/config/ConfigServerApplicationContractTest.java new file mode 100644 index 00000000..b924a341 --- /dev/null +++ b/config-server/src/test/java/com/xtrmetl/config/ConfigServerApplicationContractTest.java @@ -0,0 +1,47 @@ +package com.xtrmetl.config; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.config.server.EnableConfigServer; + +import java.io.IOException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Verifies the standalone Config Server bootstrap contract and its beginner-readable public documentation. + */ +class ConfigServerApplicationContractTest { + + @Test + void bootstrapClassKeepsTheRequiredServerAnnotations() { + assertNotNull(ConfigServerApplication.class.getAnnotation(SpringBootApplication.class)); + assertNotNull(ConfigServerApplication.class.getAnnotation(EnableConfigServer.class)); + } + + @Test + void mainEntryPointRemainsPublicStatic() throws NoSuchMethodException { + Method main = ConfigServerApplication.class.getDeclaredMethod("main", String[].class); + + assertTrue(Modifier.isPublic(main.getModifiers())); + assertTrue(Modifier.isStatic(main.getModifiers())); + } + + @Test + void publicBootstrapApiHasBeginnerReadableJavadoc() throws IOException { + String source = Files.readString( + Path.of("src/main/java/com/xtrmetl/config/ConfigServerApplication.java"), + StandardCharsets.UTF_8 + ); + + assertTrue(source.contains("Starts the standalone mightyETL Config Server")); + assertTrue(source.contains("Launches the Config Server through Spring Boot")); + assertTrue(source.contains("@param args command-line arguments passed to Spring Boot")); + } +} \ No newline at end of file