fix iam and order deployment test contracts
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ class FinanceG1G2PermissionSqlContractTest {
|
|||||||
.contains("NULL, 'POST', 150, 'ACTIVE', 1, 0")
|
.contains("NULL, 'POST', 150, 'ACTIVE', 1, 0")
|
||||||
.contains("NULL, 'PUT', 160, 'ACTIVE', 1, 0")
|
.contains("NULL, 'PUT', 160, 'ACTIVE', 1, 0")
|
||||||
.contains("permission_code IN (\n 'platform:finance',")
|
.contains("permission_code IN (\n 'platform:finance',")
|
||||||
.contains("permission_code LIKE 'platform:finance:%' AND status='ACTIVE' AND deleted=0) <> 26")
|
.contains("permission_code LIKE 'platform:finance:%' AND status='ACTIVE' AND deleted=0) <> 27")
|
||||||
.contains("平台管理员 Finance 授权不完整")
|
.contains("平台管理员 Finance 授权不完整")
|
||||||
.contains("Finance G1-G4");
|
.contains("Finance G1-G4");
|
||||||
assertThat(financeSection)
|
assertThat(financeSection)
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ class FinanceG3G4PermissionSqlContractTest {
|
|||||||
assertThat(financeSection)
|
assertThat(financeSection)
|
||||||
.contains("migrate_finance_g1_g4_permissions")
|
.contains("migrate_finance_g1_g4_permissions")
|
||||||
.contains("finance G1-G4 permission id/code conflict")
|
.contains("finance G1-G4 permission id/code conflict")
|
||||||
.contains("permission_code LIKE 'platform:finance:%' AND status='ACTIVE' AND deleted=0) <> 26");
|
.contains("permission_code LIKE 'platform:finance:%' AND status='ACTIVE' AND deleted=0) <> 27");
|
||||||
assertThat(financeSection)
|
assertThat(financeSection)
|
||||||
.contains("SELECT 4000001, id, 0 FROM baiyue_iam.iam_permission")
|
.contains("SELECT 4000001, id, 0 FROM baiyue_iam.iam_permission")
|
||||||
.contains("platform:finance:reconciliation:create")
|
.contains("platform:finance:reconciliation:create")
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ class OrderApplicationServiceStateTest {
|
|||||||
OrderMasterDataGuard masterData = mock(OrderMasterDataGuard.class);
|
OrderMasterDataGuard masterData = mock(OrderMasterDataGuard.class);
|
||||||
OrderEntity order = persistedDraft("SELF_EXPRESS", "OVERSEAS");
|
OrderEntity order = persistedDraft("SELF_EXPRESS", "OVERSEAS");
|
||||||
when(repository.findOwned(20002L, 1L)).thenReturn(order);
|
when(repository.findOwned(20002L, 1L)).thenReturn(order);
|
||||||
when(repository.findCargo(20002L, 1L)).thenReturn(List.of(new OrderCargoEntity()));
|
when(repository.findCargo(20002L, 1L)).thenReturn(List.of(completeCargo()));
|
||||||
when(repository.findParties(20002L, 1L)).thenReturn(List.of());
|
when(repository.findParties(20002L, 1L)).thenReturn(List.of());
|
||||||
when(repository.saveOrder(20002L, order)).thenReturn(1);
|
when(repository.saveOrder(20002L, order)).thenReturn(1);
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ class OrderApplicationServiceStateTest {
|
|||||||
OrderPricingChannelGuard pricing = mock(OrderPricingChannelGuard.class);
|
OrderPricingChannelGuard pricing = mock(OrderPricingChannelGuard.class);
|
||||||
OrderEntity order = persistedDraft("SELF_EXPRESS", "OVERSEAS");
|
OrderEntity order = persistedDraft("SELF_EXPRESS", "OVERSEAS");
|
||||||
when(repository.findOwned(20002L, 1L)).thenReturn(order);
|
when(repository.findOwned(20002L, 1L)).thenReturn(order);
|
||||||
when(repository.findCargo(20002L, 1L)).thenReturn(List.of(new OrderCargoEntity()));
|
when(repository.findCargo(20002L, 1L)).thenReturn(List.of(completeCargo()));
|
||||||
when(repository.findParties(20002L, 1L)).thenReturn(List.of());
|
when(repository.findParties(20002L, 1L)).thenReturn(List.of());
|
||||||
doThrow(new BizException(ResultCode.CONFLICT, "所选渠道已下线,请重新选择"))
|
doThrow(new BizException(ResultCode.CONFLICT, "所选渠道已下线,请重新选择"))
|
||||||
.when(pricing).requireAvailable(20002L, 8L, "CH");
|
.when(pricing).requireAvailable(20002L, 8L, "CH");
|
||||||
@@ -568,6 +568,16 @@ class OrderApplicationServiceStateTest {
|
|||||||
return order;
|
return order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private OrderCargoEntity completeCargo() {
|
||||||
|
OrderCargoEntity cargo = new OrderCargoEntity();
|
||||||
|
cargo.setCargoName("货物");
|
||||||
|
cargo.setPackageType("CARTON");
|
||||||
|
cargo.setPackageCount(1);
|
||||||
|
cargo.setGrossWeightKg(BigDecimal.ONE);
|
||||||
|
cargo.setVolumeCbm(BigDecimal.ONE);
|
||||||
|
return cargo;
|
||||||
|
}
|
||||||
|
|
||||||
private OrderEntity persistedOrder(OrderStatus status) {
|
private OrderEntity persistedOrder(OrderStatus status) {
|
||||||
OrderEntity order = new OrderEntity();
|
OrderEntity order = new OrderEntity();
|
||||||
order.setId(1L);
|
order.setId(1L);
|
||||||
|
|||||||
Reference in New Issue
Block a user