feat: precreate dropship pallet codes after measurement
This commit is contained in:
+3
-8
@@ -38,21 +38,16 @@ class InboundCartonLabelPrintServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void dropshipPalletLabelIsAvailableOnlyAfterSeal() {
|
||||
void dropshipPalletLabelIsAvailableBeforeSeal() {
|
||||
Pallet open = dropshipPallet("OPEN");
|
||||
assertThatThrownBy(() -> service.generateDropshipPallet(open, "request-open"))
|
||||
.isInstanceOf(BizException.class)
|
||||
.hasMessageContaining("已完成");
|
||||
verifyNoInteractions(print);
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_PDF);
|
||||
when(print.generateInboundMarks(org.mockito.ArgumentMatchers.anyString(),
|
||||
org.mockito.ArgumentMatchers.eq("request-sealed"), org.mockito.ArgumentMatchers.any()))
|
||||
org.mockito.ArgumentMatchers.eq("request-open"), org.mockito.ArgumentMatchers.any()))
|
||||
.thenReturn(new ResponseEntity<>(new byte[] {7, 8, 9}, headers,
|
||||
org.springframework.http.HttpStatus.OK));
|
||||
|
||||
ResponseEntity<byte[]> response = service.generateDropshipPallet(dropshipPallet("SEALED"), "request-sealed");
|
||||
ResponseEntity<byte[]> response = service.generateDropshipPallet(open, "PCHK2608040174", "request-open");
|
||||
assertThat(response.getBody()).containsExactly(7, 8, 9);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user