Merge branch 'test' into dev
This commit is contained in:
+8
-10
@@ -233,11 +233,9 @@ class DispatchPdaWorkflowServiceTest {
|
||||
order.setVehiclePlate("CA-100");
|
||||
DispatchPdaTask task = task(11L, "100", "WH-1", "COMPLETED");
|
||||
DispatchItem item = item(21L, "100", 6);
|
||||
DispatchPdaPick pick = new DispatchPdaPick();
|
||||
pick.setPackages(6L);
|
||||
DispatchPdaPick pick = new DispatchPdaPick(); pick.setPackages(6L);
|
||||
OutboundOrder outbound = new OutboundOrder();
|
||||
outbound.setOutboundNo("OB-1");
|
||||
outbound.setStatus("WAIT_OUTBOUND");
|
||||
outbound.setOutboundNo("OB-1"); outbound.setStatus("WAIT_OUTBOUND");
|
||||
when(orders.findGlobalByDispatchNo("DSP-1")).thenReturn(order);
|
||||
when(orders.lockById("100", 1L)).thenReturn(order);
|
||||
when(outboundOrders.lockByDispatch("100", 1L)).thenReturn(outbound);
|
||||
@@ -245,17 +243,17 @@ class DispatchPdaWorkflowServiceTest {
|
||||
when(items.findByDispatchOrder("100", 1L)).thenReturn(List.of(item));
|
||||
when(picks.totalItem("100", 11L, 21L)).thenReturn(6L);
|
||||
when(picks.listTask("100", 11L)).thenReturn(List.of(pick));
|
||||
DispatchPdaResponses.Departed result = service.depart("WH-1", "DSP-1", "7",
|
||||
new DispatchPdaRequests.Depart("depart-success", null));
|
||||
when(palletLocks.selectList(any())).thenReturn(List.of());
|
||||
|
||||
DispatchPdaResponses.Departed result = service.depart(
|
||||
"WH-1", "DSP-1", "7", new DispatchPdaRequests.Depart("depart-1", null));
|
||||
|
||||
assertEquals("DEPARTED", result.status());
|
||||
assertEquals("DEPARTED", order.getStatus());
|
||||
assertTrue(order.getDepartAt() != null);
|
||||
assertEquals("OUTBOUNDED", outbound.getStatus());
|
||||
when(palletLocks.selectList(any())).thenReturn(List.of());
|
||||
assertNotNull(order.getDepartAt());
|
||||
assertEquals(order.getDepartAt(), order.getUpdatedAt());
|
||||
verify(orders).updateById(order);
|
||||
assertEquals("DEPARTED", order.getStatus());
|
||||
assertEquals("OUTBOUNDED", outbound.getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user