|
|
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.BeforeEach;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
|
import org.mockito.ArgumentCaptor;
|
|
|
+import org.mockito.InOrder;
|
|
|
import org.mockito.Mock;
|
|
|
import org.mockito.junit.jupiter.MockitoExtension;
|
|
|
import org.springframework.core.annotation.AnnotatedElementUtils;
|
|
|
@@ -277,6 +278,14 @@ class LeshouyingOnboardingControllerTest {
|
|
|
"查询必须自带 tenant_id 谓词(超管主体下拦截器不会追加)。实测: " + w.getSqlSegment());
|
|
|
assertTrue(w.getParamNameValuePairs().containsValue(TENANT),
|
|
|
"谓词占位符必须绑定上下文里的租户 " + TENANT + "。实测: " + w.getParamNameValuePairs());
|
|
|
+
|
|
|
+ // 臂 ③:闸必须**先于**上游调用。顺序反了(先 commitMerchantInfo 再定位)不是「同样安全」——
|
|
|
+ // 那等于拿一个**还没证明属于本租户**的商户号去发起上游提交,403 只是发晚了。
|
|
|
+ // 用 InOrder 钉住:selectList(闸的查询)必须排在 commitMerchantInfo(上游调用)之前。
|
|
|
+ // ★ 2026-09-23 实测:本条断言加上之前,把这两行对调**全类仍绿**(读数见 task-7-report.md)。
|
|
|
+ InOrder gateFirst = inOrder(mapper, onboardingService);
|
|
|
+ gateFirst.verify(mapper).selectList(any());
|
|
|
+ gateFirst.verify(onboardingService).commitMerchantInfo(any());
|
|
|
}
|
|
|
|
|
|
// ───────────────────────── 权限串与应答字段名(结构性) ─────────────────────────
|