package com.battery.business; import static org.junit.jupiter.api.Assertions.assertFalse; import java.nio.file.Files; import java.nio.file.Path; import org.junit.jupiter.api.Test; /** 防止业务模块在骨架阶段意外引入具体设备实现。 */ class ModuleDependencyContractTest { @Test void businessPomKeepsVendorImplementationsOutOfItsDependencies() throws Exception { Path pom = Path.of("pom.xml"); if (!Files.exists(pom)) pom = Path.of("battery-business", "pom.xml"); String text = Files.readString(pom); assertFalse(text.contains("battery-device-bts")); assertFalse(text.contains("battery-device-simulator")); assertFalse(text.contains("spring-boot-starter-data-redis")); } }