|
|
@@ -82,21 +82,21 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pick_cityTierWins() {
|
|
|
List<HarShopEntity> candidates = List.of(
|
|
|
- ok("NJ", "32", "3201"),
|
|
|
- ok("SZ", "32", "3205"));
|
|
|
+ ok("NJ", "320000", "320100"),
|
|
|
+ ok("SZ", "320000", "320500"));
|
|
|
|
|
|
- assertEquals("NJ", pick(candidates, "32", "3201", "114.114.114.114").getThirdShopId());
|
|
|
+ assertEquals("NJ", pick(candidates, "320000", "320100", "114.114.114.114").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
/** 同城没店 ⇒ 退到同省,且**只**在省内挑(异省的店绝不越界) */
|
|
|
@Test
|
|
|
void pick_cityMissing_fallsBackToTheSameProvinceOnly() {
|
|
|
List<HarShopEntity> candidates = List.of(
|
|
|
- ok("SZ", "32", "3205"),
|
|
|
- ok("WX", "32", "3202"),
|
|
|
- ok("HZ", "33", "3301"));
|
|
|
+ ok("SZ", "320000", "320500"),
|
|
|
+ ok("WX", "320000", "320200"),
|
|
|
+ ok("HZ", "330000", "330100"));
|
|
|
|
|
|
- HarShopEntity picked = pick(candidates, "32", "3201", "114.114.114.114");
|
|
|
+ HarShopEntity picked = pick(candidates, "320000", "320100", "114.114.114.114");
|
|
|
|
|
|
assertNotNull(picked);
|
|
|
assertTrue(Set.of("SZ", "WX").contains(picked.getThirdShopId()),
|
|
|
@@ -109,27 +109,27 @@ class HarShopRegionPickTest {
|
|
|
*/
|
|
|
@Test
|
|
|
void pick_cityCodeUnderAnotherProvinceIsNotTrusted() {
|
|
|
- List<HarShopEntity> candidates = List.of(ok("X", "99", "3201"));
|
|
|
+ List<HarShopEntity> candidates = List.of(ok("X", "999999", "320100"));
|
|
|
|
|
|
- assertNull(pick(candidates, "32", "3201", "114.114.114.114"));
|
|
|
+ assertNull(pick(candidates, "320000", "320100", "114.114.114.114"));
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void pick_blankProvinceCode_picksNothing() {
|
|
|
- List<HarShopEntity> candidates = List.of(ok("NJ", "32", "3201"));
|
|
|
+ List<HarShopEntity> candidates = List.of(ok("NJ", "320000", "320100"));
|
|
|
|
|
|
- assertNull(pick(candidates, null, "3201", "114.114.114.114"));
|
|
|
- assertNull(pick(candidates, " ", "3201", "114.114.114.114"));
|
|
|
+ assertNull(pick(candidates, null, "320100", "114.114.114.114"));
|
|
|
+ assertNull(pick(candidates, " ", "320100", "114.114.114.114"));
|
|
|
// 正控:同一个候选集,省码给对就必须挑得出来(否则上两条是量具坏了在假绿)
|
|
|
- assertNotNull(pick(candidates, "32", "3201", "114.114.114.114"));
|
|
|
+ assertNotNull(pick(candidates, "320000", "320100", "114.114.114.114"));
|
|
|
}
|
|
|
|
|
|
/** 空 city 只走省级(ipwho.is 偶尔只给到省) */
|
|
|
@Test
|
|
|
void pick_blankCityCode_stillUsesTheProvinceTier() {
|
|
|
- List<HarShopEntity> candidates = List.of(ok("NJ", "32", "3201"));
|
|
|
+ List<HarShopEntity> candidates = List.of(ok("NJ", "320000", "320100"));
|
|
|
|
|
|
- assertEquals("NJ", pick(candidates, "32", null, "114.114.114.114").getThirdShopId());
|
|
|
+ assertEquals("NJ", pick(candidates, "320000", null, "114.114.114.114").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
// ──────────────────────────── 什么算「能用的店」 ────────────────────────────
|
|
|
@@ -142,31 +142,31 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pick_onlyConsidersSuccessfullyCreatedShops() {
|
|
|
List<HarShopEntity> unusable = List.of(
|
|
|
- shop("FAILED", "32", "3201", HarShopCreateStatus.FAILED, "S1"),
|
|
|
- shop("PENDING", "32", "3201", HarShopCreateStatus.PENDING, "S2"),
|
|
|
- shop("NOID", "32", "3201", HarShopCreateStatus.SUCCESS, null),
|
|
|
- shop("BLANKID", "32", "3201", HarShopCreateStatus.SUCCESS, " "),
|
|
|
- shop("NOSTATUS", "32", "3201", null, "S5"));
|
|
|
- assertNull(pick(unusable, "32", "3201", "114.114.114.114"), "未建成的店不能拿去下单");
|
|
|
+ shop("FAILED", "320000", "320100", HarShopCreateStatus.FAILED, "S1"),
|
|
|
+ shop("PENDING", "320000", "320100", HarShopCreateStatus.PENDING, "S2"),
|
|
|
+ shop("NOID", "320000", "320100", HarShopCreateStatus.SUCCESS, null),
|
|
|
+ shop("BLANKID", "320000", "320100", HarShopCreateStatus.SUCCESS, " "),
|
|
|
+ shop("NOSTATUS", "320000", "320100", null, "S5"));
|
|
|
+ assertNull(pick(unusable, "320000", "320100", "114.114.114.114"), "未建成的店不能拿去下单");
|
|
|
|
|
|
List<HarShopEntity> withOneGood = new ArrayList<>(unusable);
|
|
|
- withOneGood.add(ok("GOOD", "32", "3201"));
|
|
|
- assertEquals("GOOD", pick(withOneGood, "32", "3201", "114.114.114.114").getThirdShopId());
|
|
|
+ withOneGood.add(ok("GOOD", "320000", "320100"));
|
|
|
+ assertEquals("GOOD", pick(withOneGood, "320000", "320100", "114.114.114.114").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void pick_noCandidatesAtAll_picksNothing() {
|
|
|
- assertNull(pick(List.of(), "32", "3201", "114.114.114.114"));
|
|
|
+ assertNull(pick(List.of(), "320000", "320100", "114.114.114.114"));
|
|
|
}
|
|
|
|
|
|
// ──────────────────────────── 同地区多店:按 IP 稳定散列 ────────────────────────────
|
|
|
|
|
|
private static List<HarShopEntity> fourShopsInJiangsu() {
|
|
|
return List.of(
|
|
|
- ok("A", "32", "3201"),
|
|
|
- ok("B", "32", "3201"),
|
|
|
- ok("C", "32", "3201"),
|
|
|
- ok("D", "32", "3201"));
|
|
|
+ ok("A", "320000", "320100"),
|
|
|
+ ok("B", "320000", "320100"),
|
|
|
+ ok("C", "320000", "320100"),
|
|
|
+ ok("D", "320000", "320100"));
|
|
|
}
|
|
|
|
|
|
/** 同一个顾客(同 IP)在缓存过期后重来一次,必须还是那一家 */
|
|
|
@@ -176,8 +176,8 @@ class HarShopRegionPickTest {
|
|
|
|
|
|
for (int i = 0; i < 50; i++) {
|
|
|
String seed = "10.0." + (i / 250) + "." + (i % 250);
|
|
|
- assertEquals(pick(candidates, "32", "3201", seed).getThirdShopId(),
|
|
|
- pick(candidates, "32", "3201", seed).getThirdShopId(),
|
|
|
+ assertEquals(pick(candidates, "320000", "320100", seed).getThirdShopId(),
|
|
|
+ pick(candidates, "320000", "320100", seed).getThirdShopId(),
|
|
|
"同一 IP 必须稳定落到同一家,seed=" + seed);
|
|
|
}
|
|
|
}
|
|
|
@@ -189,7 +189,7 @@ class HarShopRegionPickTest {
|
|
|
Set<String> chosen = new HashSet<>();
|
|
|
|
|
|
for (int i = 0; i < 400; i++) {
|
|
|
- chosen.add(pick(candidates, "32", "3201", "10.0." + (i / 250) + "." + (i % 250)).getThirdShopId());
|
|
|
+ chosen.add(pick(candidates, "320000", "320100", "10.0." + (i / 250) + "." + (i % 250)).getThirdShopId());
|
|
|
}
|
|
|
|
|
|
assertEquals(Set.of("A", "B", "C", "D"), chosen, "400 个不同 IP 应把所有店都用上");
|
|
|
@@ -200,10 +200,10 @@ class HarShopRegionPickTest {
|
|
|
void pick_blankSeedIsStillDeterministic() {
|
|
|
List<HarShopEntity> candidates = fourShopsInJiangsu();
|
|
|
|
|
|
- HarShopEntity first = pick(candidates, "32", "3201", null);
|
|
|
+ HarShopEntity first = pick(candidates, "320000", "320100", null);
|
|
|
assertNotNull(first);
|
|
|
- assertEquals(first.getThirdShopId(), pick(candidates, "32", "3201", null).getThirdShopId());
|
|
|
- assertEquals(first.getThirdShopId(), pick(candidates, "32", "3201", " ").getThirdShopId());
|
|
|
+ assertEquals(first.getThirdShopId(), pick(candidates, "320000", "320100", null).getThirdShopId());
|
|
|
+ assertEquals(first.getThirdShopId(), pick(candidates, "320000", "320100", " ").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
// ──────────────────────────── 查询本身 ────────────────────────────
|
|
|
@@ -219,7 +219,7 @@ class HarShopRegionPickTest {
|
|
|
ArgumentCaptor<LambdaQueryWrapper<HarShopEntity>> captor =
|
|
|
ArgumentCaptor.forClass(LambdaQueryWrapper.class);
|
|
|
|
|
|
- assertNull(service.pickForRegion("M001", "32", "3201", "114.114.114.114"));
|
|
|
+ assertNull(service.pickForRegion("M001", "320000", "320100", "114.114.114.114"));
|
|
|
|
|
|
verify(shopMapper).selectList(captor.capture());
|
|
|
String sql = captor.getValue().getSqlSegment();
|
|
|
@@ -229,7 +229,7 @@ class HarShopRegionPickTest {
|
|
|
/** 商户号本身为空就别去查库了(空串会变成 merchant_code = '',查出一片空并静默拒收) */
|
|
|
@Test
|
|
|
void pickForRegion_blankMerchantCode_picksNothingWithoutQuerying() {
|
|
|
- assertNull(service.pickForRegion(" ", "32", "3201", "114.114.114.114"));
|
|
|
+ assertNull(service.pickForRegion(" ", "320000", "320100", "114.114.114.114"));
|
|
|
|
|
|
verify(shopMapper, org.mockito.Mockito.never()).selectList(any());
|
|
|
}
|
|
|
@@ -238,10 +238,10 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pickForRegion_picksFromWhatTheQueryReturned() {
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- ok("NJ", "32", "3201"),
|
|
|
- ok("HZ", "33", "3301")));
|
|
|
+ ok("NJ", "320000", "320100"),
|
|
|
+ ok("HZ", "330000", "330100")));
|
|
|
|
|
|
- assertEquals("NJ", service.pickForRegion("M001", "32", "3201", "114.114.114.114").getThirdShopId());
|
|
|
+ assertEquals("NJ", service.pickForRegion("M001", "320000", "320100", "114.114.114.114").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
// ──────────────── 下单按顾客归属挑店(开放 API,2026-10-09 改版:IP 优先、省码回退) ────────────────
|
|
|
@@ -261,10 +261,10 @@ class HarShopRegionPickTest {
|
|
|
void pickForOrder_ipResolves_beatsTheProvinceCode() {
|
|
|
when(ipRegionResolver.lookup("114.114.114.114")).thenReturn(Optional.of(ipGeoHunan("长沙")));
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- ok("NJ", "32", "3201"),
|
|
|
- ok("CS", "43", "4301")));
|
|
|
+ ok("NJ", "320000", "320100"),
|
|
|
+ ok("CS", "430000", "430100")));
|
|
|
|
|
|
- assertEquals("CS", service.pickForOrder("M001", "32", "114.114.114.114", "BIZ-1").getThirdShopId(),
|
|
|
+ assertEquals("CS", service.pickForOrder("M001", "320000", "114.114.114.114", "BIZ-1").getThirdShopId(),
|
|
|
"省码是江苏、IP 在湖南 ⇒ 挑湖南的店");
|
|
|
}
|
|
|
|
|
|
@@ -273,10 +273,10 @@ class HarShopRegionPickTest {
|
|
|
void pickForOrder_ipCityUnknown_fallsBackToTheIpProvince() {
|
|
|
when(ipRegionResolver.lookup("114.114.114.114")).thenReturn(Optional.of(ipGeoHunan("渝中區")));
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- ok("CS", "43", "4301"),
|
|
|
- ok("NJ", "32", "3201")));
|
|
|
+ ok("CS", "430000", "430100"),
|
|
|
+ ok("NJ", "320000", "320100")));
|
|
|
|
|
|
- assertEquals("CS", service.pickForOrder("M001", "32", "114.114.114.114", "BIZ-1").getThirdShopId(),
|
|
|
+ assertEquals("CS", service.pickForOrder("M001", "320000", "114.114.114.114", "BIZ-1").getThirdShopId(),
|
|
|
"IP 的省里有店就不该回退到调用方传的省码");
|
|
|
}
|
|
|
|
|
|
@@ -284,9 +284,9 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pickForOrder_ipRegionHasNoShop_fallsBackToProvinceCode() {
|
|
|
when(ipRegionResolver.lookup("114.114.114.114")).thenReturn(Optional.of(ipGeoHunan("长沙")));
|
|
|
- when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "32", "3201")));
|
|
|
+ when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "320000", "320100")));
|
|
|
|
|
|
- assertEquals("NJ", service.pickForOrder("M001", "32", "114.114.114.114", "BIZ-1").getThirdShopId());
|
|
|
+ assertEquals("NJ", service.pickForOrder("M001", "320000", "114.114.114.114", "BIZ-1").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
/** 挑中的店没有 third_shop_id(脏数据)与「没挑到」同权 ⇒ 同样回退省码 */
|
|
|
@@ -294,19 +294,19 @@ class HarShopRegionPickTest {
|
|
|
void pickForOrder_ipPickYieldsShopWithoutThirdShopId_fallsBackToProvinceCode() {
|
|
|
when(ipRegionResolver.lookup("114.114.114.114")).thenReturn(Optional.of(ipGeoHunan("长沙")));
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- shop(null, "43", "4301", HarShopCreateStatus.SUCCESS, "S-PLATFORM"),
|
|
|
- ok("NJ", "32", "3201")));
|
|
|
+ shop(null, "430000", "430100", HarShopCreateStatus.SUCCESS, "S-PLATFORM"),
|
|
|
+ ok("NJ", "320000", "320100")));
|
|
|
|
|
|
- assertEquals("NJ", service.pickForOrder("M001", "32", "114.114.114.114", "BIZ-1").getThirdShopId());
|
|
|
+ assertEquals("NJ", service.pickForOrder("M001", "320000", "114.114.114.114", "BIZ-1").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
/** IP 解析不出(内网/非大陆/取数失败)⇒ 有省码就按省挑 —— 这正是「两个可以同时传」的用法 */
|
|
|
@Test
|
|
|
void pickForOrder_ipUnresolvable_fallsBackToProvinceCode() {
|
|
|
when(ipRegionResolver.lookup("1.2.3.4")).thenReturn(Optional.empty());
|
|
|
- when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "32", "3201")));
|
|
|
+ when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "320000", "320100")));
|
|
|
|
|
|
- assertEquals("NJ", service.pickForOrder("M001", "32", "1.2.3.4", "BIZ-1").getThirdShopId());
|
|
|
+ assertEquals("NJ", service.pickForOrder("M001", "320000", "1.2.3.4", "BIZ-1").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
/** 解析出了但省名不在目录里 ⇒ 同样回退省码(港澳台已被解析器在更上游挡掉) */
|
|
|
@@ -314,9 +314,9 @@ class HarShopRegionPickTest {
|
|
|
void pickForOrder_ipRegionNameNotInCatalog_fallsBackToProvinceCode() {
|
|
|
when(ipRegionResolver.lookup("1.2.3.4"))
|
|
|
.thenReturn(Optional.of(new HarIpRegionResolver.IpGeo("CN", "某某省", "XX", "某市")));
|
|
|
- when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "32", "3201")));
|
|
|
+ when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "320000", "320100")));
|
|
|
|
|
|
- assertEquals("NJ", service.pickForOrder("M001", "32", "1.2.3.4", "BIZ-1").getThirdShopId());
|
|
|
+ assertEquals("NJ", service.pickForOrder("M001", "320000", "1.2.3.4", "BIZ-1").getThirdShopId());
|
|
|
}
|
|
|
|
|
|
/** 只传 ip 且解析不出:是调用方的输入错误,响亮拒绝 —— 静默不带门店下单 = 地区意图悄悄落空 */
|
|
|
@@ -336,12 +336,12 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pickForOrder_ipOnly_regionHasNoShop_400_namesTheIpRegion() {
|
|
|
when(ipRegionResolver.lookup("114.114.114.114")).thenReturn(Optional.of(ipGeoHunan("长沙")));
|
|
|
- when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "32", "3201")));
|
|
|
+ when(shopMapper.selectList(any())).thenReturn(List.of(ok("NJ", "320000", "320100")));
|
|
|
|
|
|
BusinessException e = assertThrows(BusinessException.class,
|
|
|
() -> service.pickForOrder("M001", null, "114.114.114.114", "BIZ-1"));
|
|
|
|
|
|
- assertEquals("该地区没有可用门店: 4301(省 43)", e.getMessage());
|
|
|
+ assertEquals("该地区没有可用门店: 430100(省 430000)", e.getMessage());
|
|
|
}
|
|
|
|
|
|
/** 两个都没传(上线路径由 create 的守卫挡住,这里防将来直调时抛 NPE) */
|
|
|
@@ -357,14 +357,14 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pickForOrder_provinceOnly_blankSeed_spreadsAcrossCalls() {
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- ok("A", "32", "3201"),
|
|
|
- ok("B", "32", "3201"),
|
|
|
- ok("C", "32", "3205"),
|
|
|
- ok("D", "32", "3205")));
|
|
|
+ ok("A", "320000", "320100"),
|
|
|
+ ok("B", "320000", "320100"),
|
|
|
+ ok("C", "320000", "320500"),
|
|
|
+ ok("D", "320000", "320500")));
|
|
|
|
|
|
Set<String> chosen = new HashSet<>();
|
|
|
for (int i = 0; i < 60; i++) {
|
|
|
- chosen.add(service.pickForOrder("M001", "32", null, null).getThirdShopId());
|
|
|
+ chosen.add(service.pickForOrder("M001", "320000", null, null).getThirdShopId());
|
|
|
}
|
|
|
|
|
|
assertTrue(chosen.size() > 1, "没传 out_biz_no 时也必须是随机挑而不是固定第一家,实际: " + chosen);
|
|
|
@@ -375,24 +375,24 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pickForOrder_sameOutBizNo_isStable() {
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- ok("A", "32", "3201"),
|
|
|
- ok("B", "32", "3201"),
|
|
|
- ok("C", "32", "3205"),
|
|
|
- ok("D", "32", "3205")));
|
|
|
+ ok("A", "320000", "320100"),
|
|
|
+ ok("B", "320000", "320100"),
|
|
|
+ ok("C", "320000", "320500"),
|
|
|
+ ok("D", "320000", "320500")));
|
|
|
|
|
|
- String first = service.pickForOrder("M001", "32", null, "BIZ-1").getThirdShopId();
|
|
|
+ String first = service.pickForOrder("M001", "320000", null, "BIZ-1").getThirdShopId();
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
- assertEquals(first, service.pickForOrder("M001", "32", null, "BIZ-1").getThirdShopId());
|
|
|
+ assertEquals(first, service.pickForOrder("M001", "320000", null, "BIZ-1").getThirdShopId());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void pickForOrder_provinceOnly_stillPicksWithinProvince() {
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- ok("SZ", "32", "3205"),
|
|
|
- ok("HZ", "33", "3301")));
|
|
|
+ ok("SZ", "320000", "320500"),
|
|
|
+ ok("HZ", "330000", "330100")));
|
|
|
|
|
|
- HarShopEntity picked = service.pickForOrder("M001", "32", null, "BIZ-1");
|
|
|
+ HarShopEntity picked = service.pickForOrder("M001", "320000", null, "BIZ-1");
|
|
|
|
|
|
assertEquals("SZ", picked.getThirdShopId(), "不给 IP ⇒ 按全省挑,异省的店绝不越界");
|
|
|
}
|
|
|
@@ -400,22 +400,22 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pickForOrder_unknownProvinceCode_400_sameMessageAsShopCreate() {
|
|
|
BusinessException e = assertThrows(BusinessException.class,
|
|
|
- () -> service.pickForOrder("M001", "99", null, "BIZ-1"));
|
|
|
+ () -> service.pickForOrder("M001", "999999", null, "BIZ-1"));
|
|
|
|
|
|
assertEquals(400, e.getCode());
|
|
|
- assertEquals("省份编码不存在: 99", e.getMessage(),
|
|
|
+ assertEquals("省份编码不存在: 999999", e.getMessage(),
|
|
|
"与门店创建那条必须一字不差 —— 开放文档 10.1/10.2 引用的是同一句话");
|
|
|
verify(shopMapper, org.mockito.Mockito.never()).selectList(any());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void pickForOrder_noUsableShopInProvince_400_namesTheProvince() {
|
|
|
- when(shopMapper.selectList(any())).thenReturn(List.of(ok("HZ", "33", "3301")));
|
|
|
+ when(shopMapper.selectList(any())).thenReturn(List.of(ok("HZ", "330000", "330100")));
|
|
|
|
|
|
BusinessException e = assertThrows(BusinessException.class,
|
|
|
- () -> service.pickForOrder("M001", "32", null, "BIZ-1"));
|
|
|
+ () -> service.pickForOrder("M001", "320000", null, "BIZ-1"));
|
|
|
|
|
|
- assertEquals("该地区没有可用门店: 省 32", e.getMessage());
|
|
|
+ assertEquals("该地区没有可用门店: 省 320000", e.getMessage());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -426,11 +426,11 @@ class HarShopRegionPickTest {
|
|
|
@Test
|
|
|
void pickForOrder_pickedShopWithoutThirdShopId_400() {
|
|
|
when(shopMapper.selectList(any())).thenReturn(List.of(
|
|
|
- shop(null, "32", "3201", HarShopCreateStatus.SUCCESS, "S-PLATFORM")));
|
|
|
+ shop(null, "320000", "320100", HarShopCreateStatus.SUCCESS, "S-PLATFORM")));
|
|
|
|
|
|
BusinessException e = assertThrows(BusinessException.class,
|
|
|
- () -> service.pickForOrder("M001", "32", null, "BIZ-1"));
|
|
|
+ () -> service.pickForOrder("M001", "320000", null, "BIZ-1"));
|
|
|
|
|
|
- assertEquals("该地区没有可用门店: 省 32", e.getMessage());
|
|
|
+ assertEquals("该地区没有可用门店: 省 320000", e.getMessage());
|
|
|
}
|
|
|
}
|