From cb008ad64de54e87b1c2fa183a931a321490f9cf Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Sun, 20 Sep 2026 15:57:51 +0800 Subject: [PATCH] test(firstleg): cover printable pallet without nickname --- .../firstleg/service/IamCustomerSnapshotServiceTest.java | 8 ++++++++ .../service/InboundCartonLabelPrintServiceTest.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/firstleg/src/test/java/com/baiyue/firstleg/service/IamCustomerSnapshotServiceTest.java b/firstleg/src/test/java/com/baiyue/firstleg/service/IamCustomerSnapshotServiceTest.java index e1d8457e9..2f4871954 100644 --- a/firstleg/src/test/java/com/baiyue/firstleg/service/IamCustomerSnapshotServiceTest.java +++ b/firstleg/src/test/java/com/baiyue/firstleg/service/IamCustomerSnapshotServiceTest.java @@ -66,4 +66,12 @@ class IamCustomerSnapshotServiceTest { assertThat(service.customerNickname(7L)).isEqualTo("Short Name"); } + + @Test + void usesPlaceholderForPrintWhenCustomerNicknameIsMissing() { + when(client.page("internal-token", 1, 2, null, null, 7L)) + .thenReturn(ApiResponse.success(new PageResult<>(List.of(), 1, 2, 0, 0))); + + assertThat(service.customerNicknameForPrint(7L)).isEqualTo("—"); + } } diff --git a/firstleg/src/test/java/com/baiyue/firstleg/service/InboundCartonLabelPrintServiceTest.java b/firstleg/src/test/java/com/baiyue/firstleg/service/InboundCartonLabelPrintServiceTest.java index 0017a7a62..ee0c475f9 100644 --- a/firstleg/src/test/java/com/baiyue/firstleg/service/InboundCartonLabelPrintServiceTest.java +++ b/firstleg/src/test/java/com/baiyue/firstleg/service/InboundCartonLabelPrintServiceTest.java @@ -320,6 +320,6 @@ class InboundCartonLabelPrintServiceTest { sku.setMaxUnitsPerCarton(19); when(palletization.printSkuRows(palletId)) .thenReturn(palletId == 90001L ? List.of(sku) : List.of()); - when(customerSnapshots.customerNickname(10001L)).thenReturn("小虫科技"); + when(customerSnapshots.customerNicknameForPrint(10001L)).thenReturn("小虫科技"); } }