fix(lastleg): keep unconfirmed container resources recoverable
This commit is contained in:
+18
@@ -123,6 +123,24 @@ class ReceivingContainerServiceBehaviorTest {
|
||||
verifyNoInteractions(warehouse);
|
||||
}
|
||||
|
||||
@Test
|
||||
void localCommittedResourcesAreNotPdaCandidatesOrReceivableDespiteCompleteLocalPalletBindings() {
|
||||
InboundPlan pending = plan("CONT-A");
|
||||
when(plans.selectList(any())).thenReturn(List.of(pending));
|
||||
when(lines.selectList(any())).thenReturn(List.of(line("FBA")));
|
||||
when(orders.selectList(any())).thenReturn(List.of(containerOrder(1L, "100", "CONT-A", "BOOKING-A", "IN-1")));
|
||||
when(plans.countUnconfirmedResourcePlans(pending.getCustomerId(), pending.getId())).thenReturn(1L);
|
||||
var candidates = service.candidates("7", 100L);
|
||||
assertThat(candidates).hasSize(1);
|
||||
assertThat(candidates.get(0).operable()).isFalse();
|
||||
assertThat(candidates.get(0).blockReason()).contains("资源尚未确认");
|
||||
assertThatThrownBy(() -> service.prepare("7", "receiver", 100L, "CONT-A", "BOOKING-A",
|
||||
new ReceivingContainerRequests.Action("reserved-only")))
|
||||
.isInstanceOf(ResponseStatusException.class).hasMessageContaining("资源尚未确认");
|
||||
verify(pallets, never()).selectCount(any());
|
||||
verifyNoInteractions(warehouse);
|
||||
}
|
||||
|
||||
@Test
|
||||
void prepareIdempotencyHashIncludesContainerPath() {
|
||||
when(plans.selectList(any())).thenReturn(List.of(plan("CONT-A")));
|
||||
|
||||
Reference in New Issue
Block a user