docs: align readme with runtime stack
This commit is contained in:
@@ -43,12 +43,38 @@ class MavenModuleProfileTest {
|
||||
"modules/apps/xinda-push-app");
|
||||
}
|
||||
|
||||
@Test
|
||||
void readmeMatchesCurrentRuntimeVersionsAndSplitAppResponsibilities() throws Exception {
|
||||
Document pom = rootPom();
|
||||
String readme = Files.readString(repositoryRoot().resolve("README.md"));
|
||||
|
||||
assertThat(readme)
|
||||
.contains("Spring Boot " + projectProperty(pom, "spring-boot.version"))
|
||||
.contains("Netty " + projectProperty(pom, "netty.version"))
|
||||
.contains("Eclipse Paho " + projectProperty(pom, "paho-mqtt.version"))
|
||||
.contains("vehicle-history-app/ TDengine 历史查询 + RAW JSON")
|
||||
.contains("vehicle-analytics-app/ JT808 每日里程指标消费")
|
||||
.doesNotContain("Spring Boot 3.4")
|
||||
.doesNotContain("Netty 4.1")
|
||||
.doesNotContain("HiveMQ MQTT Client")
|
||||
.doesNotContain("车辆状态/日统计消费");
|
||||
}
|
||||
|
||||
private static Document rootPom() throws Exception {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
|
||||
return factory.newDocumentBuilder().parse(Files.newInputStream(repositoryRoot().resolve("pom.xml")));
|
||||
}
|
||||
|
||||
private static String projectProperty(Document pom, String name) {
|
||||
Element properties = firstDirectChild(pom.getDocumentElement(), "properties");
|
||||
Element property = firstDirectChild(properties, name);
|
||||
if (property == null) {
|
||||
throw new IllegalArgumentException("project property not found: " + name);
|
||||
}
|
||||
return property.getTextContent().trim();
|
||||
}
|
||||
|
||||
private static List<String> defaultModules(Document pom) {
|
||||
Element project = pom.getDocumentElement();
|
||||
return directModules(firstDirectChild(project, "modules"));
|
||||
|
||||
Reference in New Issue
Block a user