chore: keep swagger on api apps only

This commit is contained in:
lingniu
2026-07-01 15:32:17 +08:00
parent dc56a664f4
commit 53f8f79c3e
13 changed files with 35 additions and 41 deletions

View File

@@ -294,6 +294,25 @@ class MavenModuleProfileTest {
}
}
@Test
void springdocUiIsOnlyPackagedWithAppsThatExposeRestApis() throws Exception {
for (String appPom : List.of(
"modules/apps/gb32960-ingest-app/pom.xml",
"modules/apps/jt808-ingest-app/pom.xml",
"modules/apps/yutong-mqtt-app/pom.xml")) {
assertThat(hasDependency(modulePom(appPom), "org.springdoc", "springdoc-openapi-starter-webmvc-ui"))
.as(appPom + " exposes Actuator only; Swagger UI belongs to query/API apps")
.isFalse();
}
for (String appPom : List.of(
"modules/apps/vehicle-history-app/pom.xml",
"modules/apps/vehicle-analytics-app/pom.xml")) {
assertThat(hasDependency(modulePom(appPom), "org.springdoc", "springdoc-openapi-starter-webmvc-ui"))
.as(appPom + " exposes REST APIs")
.isTrue();
}
}
@Test
void buildSurfaceDoesNotManageLombokWhenProductionSourcesDoNotUseIt() throws Exception {
Document pom = rootPom();

View File

@@ -163,8 +163,9 @@ class PortainerComposeResourceLimitsTest {
.contains("launchctl bootout \"gui/$(id -u)\" \"$HOME/Library/LaunchAgents/com.lingniu.yutong-mqtt.plist\" || true")
.contains("launchctl bootout \"gui/$(id -u)\" \"$HOME/Library/LaunchAgents/com.lingniu.vehicle-analytics.plist\" || true")
.contains("launchctl list | rg 'com.lingniu.(gb32960|jt808|yutong-mqtt|vehicle-history|vehicle-analytics)'")
.contains("Yutong MQTT ingest: `http://127.0.0.1:20500/swagger-ui/index.html`")
.contains("Yutong MQTT ingest health: `http://127.0.0.1:20500/actuator/health`")
.contains("Analytics metrics: `http://127.0.0.1:20300/swagger-ui/index.html`")
.doesNotContain("Yutong MQTT ingest: `http://127.0.0.1:20500/swagger-ui/index.html`")
.doesNotContain("sed \\")
.doesNotContain("三个服务");
@@ -451,7 +452,8 @@ class PortainerComposeResourceLimitsTest {
assertThat(readme)
.contains("`jt808-ingest-app`: TCP `808`HTTP `20400`")
.contains("curl -sS http://127.0.0.1:20400/actuator/health")
.contains("JT808 ingest: `http://127.0.0.1:20400/swagger-ui/index.html`")
.contains("JT808 ingest health: `http://127.0.0.1:20400/actuator/health`")
.doesNotContain("JT808 ingest: `http://127.0.0.1:20400/swagger-ui/index.html`")
.doesNotContain("20482");
}