fix(warehouse): keep partner query record bindable
This commit is contained in:
+2
-2
@@ -27,12 +27,12 @@ class PlatformMasterDataControllerContractTest {
|
||||
for (String type : java.util.List.of(
|
||||
"CUSTOMER", "SUPPLIER", "BOTH", "CARRIER", "CUSTOMS_BROKER", "SHIPPER", "CONSIGNEE")) {
|
||||
var query = new com.baiyue.warehouse.dto.MasterDataQueries.PartnerPageQuery(
|
||||
1, 20, null, type, null);
|
||||
1, 20, null, type, null, null);
|
||||
assertThat(validator.validate(query)).isEmpty();
|
||||
}
|
||||
|
||||
var invalid = new com.baiyue.warehouse.dto.MasterDataQueries.PartnerPageQuery(
|
||||
1, 20, null, "UNKNOWN", null);
|
||||
1, 20, null, "UNKNOWN", null, null);
|
||||
assertThat(validator.validate(invalid))
|
||||
.extracting(violation -> violation.getPropertyPath().toString())
|
||||
.containsExactly("type");
|
||||
|
||||
@@ -65,7 +65,7 @@ class PartnerRepositoryTest {
|
||||
eq("ACTIVE"), eq("示例"))).thenAnswer(invocation -> invocation.getArgument(0));
|
||||
|
||||
repository.page(10001L,
|
||||
new PartnerPageQuery(1, 20, "示例", "CUSTOMER", "ACTIVE"));
|
||||
new PartnerPageQuery(1, 20, "示例", "CUSTOMER", "ACTIVE", null));
|
||||
|
||||
verify(mapper).selectPartnerPageByType(any(Page.class), eq(10001L), eq("CUSTOMER"),
|
||||
eq("ACTIVE"), eq("示例"));
|
||||
@@ -77,7 +77,7 @@ class PartnerRepositoryTest {
|
||||
eq("ACTIVE"), isNull())).thenAnswer(invocation -> invocation.getArgument(0));
|
||||
|
||||
repository.page(null,
|
||||
new PartnerPageQuery(1, 20, null, "CARRIER", "ACTIVE"));
|
||||
new PartnerPageQuery(1, 20, null, "CARRIER", "ACTIVE", null));
|
||||
|
||||
verify(mapper).selectPartnerPageByType(any(Page.class), isNull(), eq("CARRIER"),
|
||||
eq("ACTIVE"), isNull());
|
||||
@@ -102,7 +102,7 @@ class PartnerRepositoryTest {
|
||||
when(mapper.selectTypes(List.of(10001L, 10002L), List.of(7L, 7L)))
|
||||
.thenReturn(List.of(typeA, typeB));
|
||||
|
||||
repository.page(null, new PartnerPageQuery(1, 20, null, null, null));
|
||||
repository.page(null, new PartnerPageQuery(1, 20, null, null, null, null));
|
||||
|
||||
assertThat(customerA.getTypes()).containsExactly("CUSTOMER");
|
||||
assertThat(customerB.getTypes()).containsExactly("SUPPLIER");
|
||||
|
||||
Reference in New Issue
Block a user