This commit is contained in:
2026-10-20 10:35:52 +08:00
parent ce189f062f
commit c13175bf77
202 changed files with 38397 additions and 7138 deletions
@@ -57,6 +57,10 @@ class FleetHandoverPdaQueryTest {
assertThrows(org.springframework.web.server.ResponseStatusException.class, () -> service.status(92, "PC-A"));
verifyNoInteractions(history, handovers);
}
@Test void sameWarehouseEmptyEvidenceCannotBorrowTheTruckHeaderQuantity() {
when(dispatches.transitEvidence("PC-A",false)).thenReturn(new FleetTransitEvidence("PC-A","92",30,List.of()));
assertThrows(org.springframework.web.server.ResponseStatusException.class,()->service.status(92,"PC-A"));verifyNoInteractions(history,handovers);
}
@Test void controllerHasOnlyReadRouteAndRequiresThePdaIdentityPolicy() {
var policy = PdaFleetHandoverController.class.getAnnotation(org.springframework.security.access.prepost.PreAuthorize.class).value();
assertTrue(policy.contains("lastleg:pda:operate")); assertTrue(policy.contains("ROLE_OVERSEAS_WAREHOUSE_PDA_OPERATOR"));
@@ -98,7 +98,6 @@ class FleetHandoverTransactionTest {
assertEquals("11", result.snapshot().previous().vehicleId()); assertEquals("12", result.snapshot().replacement().vehicleId());
assertEquals(result.handoverNo(), service.confirm("TR-ONE", "another-operator", command).handoverNo());
verify(dispatches, times(1)).handover(any(), any());
verify(dispatches, never()).depart(anyString(), anyString(), anyString(), anyString(), any(), any());
assertEquals(1, repository.count(1));
}