🐛 修正待回单确认单测的桩返回类型与夹具
This commit is contained in:
+8
-1
@@ -72,6 +72,13 @@ class DriverWaybillAutoCompleteTest {
|
|||||||
{"key":"return","name":"回单","type":"confirm","enabled":true,"punch":true,"confirmMode":"yes"}]
|
{"key":"return","name":"回单","type":"confirm","enabled":true,"punch":true,"confirmMode":"yes"}]
|
||||||
""";
|
""";
|
||||||
|
|
||||||
|
/** 装货 → 签收两个司机打卡节点,末位是签收,回单需确认完成 */
|
||||||
|
private static final String LOAD_SIGN_RETURN_CONFIRM_JSON = """
|
||||||
|
[{"key":"load","name":"装货","type":"cargo","enabled":true,"punch":true},
|
||||||
|
{"key":"sign","name":"签收","type":"cargo","enabled":true,"punch":true},
|
||||||
|
{"key":"return","name":"回单","type":"confirm","enabled":true,"punch":true,"confirmMode":"yes"}]
|
||||||
|
""";
|
||||||
|
|
||||||
/** 末位打卡节点是「发货」,不是到货/卸货/签收 */
|
/** 末位打卡节点是「发货」,不是到货/卸货/签收 */
|
||||||
private static final String DISPATCH_LAST_JSON = """
|
private static final String DISPATCH_LAST_JSON = """
|
||||||
[{"key":"dispatch","name":"发货","type":"cargo","enabled":true,"punch":true}]
|
[{"key":"dispatch","name":"发货","type":"cargo","enabled":true,"punch":true}]
|
||||||
@@ -190,7 +197,7 @@ class DriverWaybillAutoCompleteTest {
|
|||||||
@Test
|
@Test
|
||||||
@DisplayName("回单需确认但不是末位打卡:运单留在进行中")
|
@DisplayName("回单需确认但不是末位打卡:运单留在进行中")
|
||||||
void nonLastPunchDoesNotEnterReturnConfirmation() {
|
void nonLastPunchDoesNotEnterReturnConfirmation() {
|
||||||
givenWaybill(SIGN_LAST_RETURN_CONFIRM_JSON, "running");
|
givenWaybill(LOAD_SIGN_RETURN_CONFIRM_JSON, "running");
|
||||||
|
|
||||||
DriverNodePunchVO vo = submit("load");
|
DriverNodePunchVO vo = submit("load");
|
||||||
|
|
||||||
|
|||||||
+12
-1
@@ -152,7 +152,18 @@ class DriverWaybillTabStatusTest {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private Collection<Object> queriedStatuses() {
|
private Collection<Object> queriedStatuses() {
|
||||||
assertEquals(1, queried.size(), "一次列表查询");
|
assertEquals(1, queried.size(), "一次列表查询");
|
||||||
return ((LambdaQueryWrapper<Waybill>) queried.get(0)).getParamNameValuePairs().values();
|
LambdaQueryWrapper<Waybill> wrapper = (LambdaQueryWrapper<Waybill>) queried.get(0);
|
||||||
|
// 参数槽由 SQL 片段构建时填充:不先取一次片段,参数表是空的
|
||||||
|
wrapper.getSqlSegment();
|
||||||
|
Collection<Object> statuses = new ArrayList<>();
|
||||||
|
wrapper.getParamNameValuePairs().values().forEach(value -> {
|
||||||
|
if (value instanceof Collection<?> items) {
|
||||||
|
statuses.addAll(items);
|
||||||
|
} else {
|
||||||
|
statuses.add(value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return statuses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|||||||
+1
-1
@@ -175,7 +175,7 @@ class WaybillEditSaveBusinessStatusTest {
|
|||||||
when(waybillMapper.selectById(WAYBILL_ID)).thenReturn(oldRecord);
|
when(waybillMapper.selectById(WAYBILL_ID)).thenReturn(oldRecord);
|
||||||
|
|
||||||
try (MockedStatic<AuthUtil> authUtil = mockStatic(AuthUtil.class)) {
|
try (MockedStatic<AuthUtil> authUtil = mockStatic(AuthUtil.class)) {
|
||||||
authUtil.when(AuthUtil::getDeptId).thenReturn(DEPT_ID);
|
authUtil.when(AuthUtil::getDeptId).thenReturn(String.valueOf(DEPT_ID));
|
||||||
assertTrue(service.submit(request));
|
assertTrue(service.submit(request));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user