修复费用记录、装柜完成及海外履约资料
This commit is contained in:
+8
-5
@@ -58,12 +58,14 @@ class InboundPlanServiceTest {
|
||||
@Mock WarehouseResourceGateway warehouseGateway;
|
||||
@Mock LastlegOrderCommandRecordMapper commandMapper;
|
||||
@Mock LastlegSourcePalletMapper sourcePalletMapper;
|
||||
@Mock com.baiyue.lastleg.service.ContainerWarehouseArrivalService warehouseArrival;
|
||||
|
||||
private InboundPlanService service;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
service = new InboundPlanService();
|
||||
ReflectionTestUtils.setField(service,"warehouseArrival",warehouseArrival);
|
||||
ReflectionTestUtils.setField(service, "planMapper", planMapper);
|
||||
ReflectionTestUtils.setField(service, "lineMapper", lineMapper);
|
||||
ReflectionTestUtils.setField(service, "palletMapper", palletMapper);
|
||||
@@ -95,8 +97,8 @@ class InboundPlanServiceTest {
|
||||
"100", 2L, "BOOKING-1", "193000000000200003")));
|
||||
org.mockito.Mockito.lenient().when(orderMapper.findSourceContainerBookingId(any(), anyLong()))
|
||||
.thenReturn("BOOKING-1");
|
||||
org.mockito.Mockito.lenient().when(orderMapper.containerEstimatedWarehouseTimes(any()))
|
||||
.thenReturn(List.of(LocalDateTime.of(2026, 9, 15, 8, 0)));
|
||||
org.mockito.Mockito.lenient().when(warehouseArrival.requiredDate(any()))
|
||||
.thenReturn(java.time.LocalDate.of(2026, 9, 15));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -176,15 +178,16 @@ class InboundPlanServiceTest {
|
||||
void manualPlanRejectsMissingOrInconsistentContainerArrivalTime() {
|
||||
ManualInboundPlanRequest request = new ManualInboundPlanRequest("100", 2L, 0,
|
||||
2, "STANDARD", true, true, true, "优先收货");
|
||||
when(orderMapper.containerEstimatedWarehouseTimes("BOOKING-1")).thenReturn(List.of());
|
||||
when(warehouseArrival.requiredDate("BOOKING-1")).thenThrow(new ResponseStatusException(org.springframework.http.HttpStatus.CONFLICT,"来源柜预计到仓时间缺失,请先补齐柜级时间"));
|
||||
|
||||
ResponseStatusException missing = assertThrows(ResponseStatusException.class,
|
||||
() -> service.convertManual(request, "manual-missing-arrival", "900"));
|
||||
assertEquals(409, missing.getStatusCode().value());
|
||||
assertEquals("来源柜预计到仓时间缺失,请先补齐柜级时间", missing.getReason());
|
||||
|
||||
when(orderMapper.containerEstimatedWarehouseTimes("BOOKING-1")).thenReturn(List.of(
|
||||
LocalDateTime.of(2026, 9, 15, 8, 0), LocalDateTime.of(2026, 9, 16, 8, 0)));
|
||||
org.mockito.Mockito.doThrow(new ResponseStatusException(
|
||||
org.springframework.http.HttpStatus.CONFLICT,"来源柜预计到仓时间不一致,请先修正柜级时间"))
|
||||
.when(warehouseArrival).requiredDate("BOOKING-1");
|
||||
ResponseStatusException inconsistent = assertThrows(ResponseStatusException.class,
|
||||
() -> service.convertManual(request, "manual-inconsistent-arrival", "900"));
|
||||
assertEquals(409, inconsistent.getStatusCode().value());
|
||||
|
||||
Reference in New Issue
Block a user