完成单机TEST统一入口与可靠投递回归收尾
This commit is contained in:
+8
-8
@@ -11,14 +11,14 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
class WarehouseDatabaseGuardConfigurationTest {
|
||||
@Test
|
||||
void applicationDefaultsTargetDedicatedOverseasWarehouseDatabase() throws Exception {
|
||||
var properties = new YamlPropertySourceLoader()
|
||||
.load("application", new ClassPathResource("application.yml"))
|
||||
.get(0);
|
||||
|
||||
assertThat(properties.getProperty("spring.datasource.url"))
|
||||
.asString()
|
||||
.contains("baiyue_lastlag_warehouse")
|
||||
void testConfigurationTargetsDedicatedWarehouseDatabaseViaRequiredExternalSettings() throws Exception {
|
||||
var root = java.nio.file.Path.of("..");
|
||||
String nacos = java.nio.file.Files.readString(root.resolve("config/nacos/test/warehouse-overseas-service.yml"));
|
||||
String compose = java.nio.file.Files.readString(root.resolve("deploy/docker-compose.yml"));
|
||||
String example = java.nio.file.Files.readString(root.resolve("deploy/env/.env.test.example"));
|
||||
assertThat(nacos).contains("url: ${WAREHOUSE_DB_URL}");
|
||||
assertThat(compose).contains("WAREHOUSE_DB_URL: ${WAREHOUSE_OVERSEAS_DB_URL}");
|
||||
assertThat(example).contains("WAREHOUSE_OVERSEAS_DB_URL=jdbc:mysql://host.docker.internal:3306/baiyue_lastlag_warehouse")
|
||||
.doesNotContain("baiyue_warehouse_overseas");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user