|
@@ -100,6 +100,32 @@ class LsyMerchantServiceTest {
|
|
|
assertEquals(404, ex.getCode());
|
|
assertEquals(404, ex.getCode());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * ★ 文案不能把调用方送去一个**它自己进不去**的地方(2026-09-30)。
|
|
|
|
|
+ *
|
|
|
|
|
+ * <p>本次改动之前,「请先在「手工登记商户号」中登记」是**可照做**的指引 ——
|
|
|
|
|
+ * 那时租户能自助录入商户号。改动后录入改成**超管代录**
|
|
|
|
|
+ * ({@code LeshouyingMerchantController} 的 save/delete 挂 {@code @perm.hasRole('SUPERUSER')}):
|
|
|
|
|
+ * 租户既看不到新增按钮、端点也 403,同一句话就成了一条**死路** ——
|
|
|
|
|
+ * 操作员会照着它去那一页找一个不存在的按钮。
|
|
|
|
|
+ *
|
|
|
|
|
+ * <p>两侧都断言,缺一不可:只断言「不含旧说法」的话,把 message 换成空串也能绿。
|
|
|
|
|
+ * 前端同款文案见 {@code collection/merchant/index.vue} 的只读提示。
|
|
|
|
|
+ */
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void requireByEnterprise_missing_message_routesToPlatformOps_notToTheNowReadOnlyPage() {
|
|
|
|
|
+ when(merchantMapper.selectOne(any())).thenReturn(null);
|
|
|
|
|
+
|
|
|
|
|
+ BusinessException ex = assertThrows(BusinessException.class,
|
|
|
|
|
+ () -> service.requireByEnterprise(1L, "ENT1"));
|
|
|
|
|
+
|
|
|
|
|
+ assertEquals(404, ex.getCode());
|
|
|
|
|
+ String msg = ex.getMessage();
|
|
|
|
|
+ assertTrue(msg.contains("联系平台运营"), "租户能照做的动作只有「联系平台运营」。实测文案: " + msg);
|
|
|
|
|
+ assertFalse(msg.contains("手工登记商户号"),
|
|
|
|
|
+ "「手工登记商户号」对租户已只读 ⇒ 不能再叫它去那里登记。实测文案: " + msg);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Test
|
|
@Test
|
|
|
void requireByEnterprise_blankEnterpriseId_throws() {
|
|
void requireByEnterprise_blankEnterpriseId_throws() {
|
|
|
assertThrows(BusinessException.class, () -> service.requireByEnterprise(1L, " "));
|
|
assertThrows(BusinessException.class, () -> service.requireByEnterprise(1L, " "));
|
|
@@ -135,6 +161,25 @@ class LsyMerchantServiceTest {
|
|
|
assertTrue(ex.getMessage().contains("未配置商户号"), "实测文案: " + ex.getMessage());
|
|
assertTrue(ex.getMessage().contains("未配置商户号"), "实测文案: " + ex.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 同 {@code requireByEnterprise_missing_message_…}:租户级那条出口也要改口。
|
|
|
|
|
+ *
|
|
|
|
|
+ * <p>两个出口各钉一条、不合并成一条,是因为它们是**两处独立的字面量** ——
|
|
|
|
|
+ * 修一处不会让另一处变红。
|
|
|
|
|
+ */
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void requireByTenant_missing_message_routesToPlatformOps_notToTheNowReadOnlyPage() {
|
|
|
|
|
+ when(merchantMapper.selectOne(any())).thenReturn(null);
|
|
|
|
|
+
|
|
|
|
|
+ BusinessException ex = assertThrows(BusinessException.class, () -> service.requireByTenant(1L));
|
|
|
|
|
+
|
|
|
|
|
+ assertEquals(404, ex.getCode());
|
|
|
|
|
+ String msg = ex.getMessage();
|
|
|
|
|
+ assertTrue(msg.contains("联系平台运营"), "租户能照做的动作只有「联系平台运营」。实测文案: " + msg);
|
|
|
|
|
+ assertFalse(msg.contains("手工登记商户号"),
|
|
|
|
|
+ "「手工登记商户号」对租户已只读 ⇒ 不能再叫它去那里登记。实测文案: " + msg);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* ★ 本组最要紧的一条:钉住**查询条件里带 {@code enterprise_id IS NULL}**。
|
|
* ★ 本组最要紧的一条:钉住**查询条件里带 {@code enterprise_id IS NULL}**。
|
|
|
*
|
|
*
|