feat: close overseas wallet and pallet cost flow

This commit is contained in:
2026-09-05 22:26:25 +08:00
parent f62283fb7f
commit 5fbd2bbd04
69 changed files with 1598 additions and 53 deletions
@@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test;
import jakarta.annotation.Resource;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.jdbc.core.JdbcTemplate;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
@@ -24,8 +25,18 @@ import java.util.List;
class PalletApplicationServiceTest {
@MockBean private PalletRepository repository;
@MockBean private WarehouseRepository warehouseRepository;
@MockBean private JdbcTemplate jdbcTemplate;
@Resource private PalletApplicationService service;
@Test
void summarizesIdleAndOccupiedPallets() {
PalletRequests.PageQuery query = new PalletRequests.PageQuery(1, 20, 20L, "PLT", "木托盘");
when(jdbcTemplate.queryForMap(org.mockito.ArgumentMatchers.anyString(), org.mockito.ArgumentMatchers.any(Object[].class)))
.thenReturn(java.util.Map.of("total_count", 7L, "occupied_count", 3L));
org.assertj.core.api.Assertions.assertThat(service.summary(0, query))
.extracting("totalCount", "idleCount", "occupiedCount").containsExactly(7L, 4L, 3L);
}
@Test
void shouldHandleCase01() {
PalletEntity entity = pallet();