This commit is contained in:
2026-08-27 14:53:27 +08:00
parent ed3c1dafcc
commit d7bff980ca
18 changed files with 991 additions and 46 deletions
@@ -27,6 +27,9 @@ class InitialWarehouseResourceSeedSqlContractTest {
}
private static void assertSeed(String sql, String yiwuId, String dongguanId, String idPrefix) {
int locationSeedStart = sql.indexOf("WHEN zones.zone_index = 0 AND slots.slot_number = 1 THEN 201");
int locationSeedEnd = sql.indexOf("DROP PROCEDURE IF EXISTS assert_yiwu_location_seed", locationSeedStart);
String locationSeed = sql.substring(locationSeedStart, locationSeedEnd);
assertThat(sql)
.contains("0," + yiwuId + ",'TP-001','木托盘'")
.contains("0," + dongguanId + ",'TP-002','塑料托盘'")
@@ -50,11 +53,12 @@ class InitialWarehouseResourceSeedSqlContractTest {
.contains("(" + idPrefix + "204,0," + dongguanId + ",'A','A区','A0'")
.contains("shared_overflow")
.contains("'AVAILABLE'")
.doesNotContain("status='AVAILABLE',\n remark=VALUES(remark)")
.doesNotContain("status = 'AVAILABLE',\n remark = VALUES(remark)")
.doesNotContain("remark=VALUES(remark),\n deleted=0")
.doesNotContain("remark = VALUES(remark),\n deleted = 0")
.doesNotContain("INSERT INTO wh_location_reservation")
.doesNotContain("INSERT INTO wh_location_occupancy");
assertThat(locationSeed)
.doesNotContain("status='AVAILABLE'")
.doesNotContain("status = 'AVAILABLE'")
.doesNotContain("deleted=0")
.doesNotContain("deleted = 0");
}
}