fix(iam): 修复仓库角色统一迁移执行
This commit is contained in:
@@ -17,7 +17,14 @@ class WarehouseRoleSqlContractTest {
|
||||
|
||||
@Test
|
||||
void unifiedDeploymentContainsTheSameWarehouseRoleContract() throws Exception {
|
||||
assertWarehouseRoleContract(unifiedSql());
|
||||
String sql = unifiedSql();
|
||||
assertWarehouseRoleContract(sql);
|
||||
assertThat(sql)
|
||||
.doesNotContain("\n ADD COLUMN IF NOT EXISTS")
|
||||
.doesNotContain("DROP CHECK IF EXISTS");
|
||||
assertThat(sql.lastIndexOf("SELECT 'PASS' AS migration_status"))
|
||||
.isGreaterThan(sql.indexOf("CALL assert_phase3_warehouse_roles_ready()"));
|
||||
assertThat(sql.trim()).endsWith("AS message;");
|
||||
}
|
||||
|
||||
private static void assertWarehouseRoleContract(String sql) {
|
||||
@@ -32,9 +39,9 @@ class WarehouseRoleSqlContractTest {
|
||||
.contains("'WAREHOUSE_TALLY', 'platform:firstleg:pda:review'")
|
||||
.contains("'WAREHOUSE_TALLY', 'platform:firstleg:inbound:loading:edit'")
|
||||
.contains("'WAREHOUSE_OPERATOR', 'platform:firstleg:inbound:loading:edit'")
|
||||
.contains("WHERE role_code = 'WAREHOUSE_OPERATOR') <> 5")
|
||||
.contains("WHERE role_code = 'WAREHOUSE_PICKER') <> 2")
|
||||
.contains("WHERE role_code = 'WAREHOUSE_TALLY') <> 12")
|
||||
.contains("operator_permission_count <> 5")
|
||||
.contains("picker_permission_count <> 2")
|
||||
.contains("tally_permission_count <> 12")
|
||||
.contains("依赖的三期平台权限尚未完整部署")
|
||||
.contains("DELETE role_permission")
|
||||
.contains("expected.permission_code IS NULL")
|
||||
@@ -61,6 +68,7 @@ class WarehouseRoleSqlContractTest {
|
||||
.doesNotContain("platform:firstleg:outbound-dispatch:confirm");
|
||||
assertThat(roleGrantBlock(sql, "WAREHOUSE_TALLY"))
|
||||
.doesNotContain("platform:firstleg:inbound:loading:complete")
|
||||
.doesNotContain("platform:firstleg:inbound:picking:view")
|
||||
.doesNotContain("platform:firstleg:outbound-dispatch:confirm");
|
||||
assertThat(sql)
|
||||
.doesNotContain("'WAREHOUSE_OPERATOR', 'platform:firstleg:pda:assign'")
|
||||
|
||||
Reference in New Issue
Block a user