Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;

/**
* Starts the standalone mightyETL Config Server.
*
* <p>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.</p>
*/
@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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"));
}
}
Loading