test(backend): C 端核心链路契约测试 37 条,mvn test 不再是 No tests to run
为什么:红线第 8 条要求后端 mvn test 通过且核心接口有契约测试;此前 13 个模块全是 No tests to run.,这个"通过"是空的。按 M2 口径只补 C 端核心链路最小集。 - 接入层契约(MockMvc,真控制器 + 真全局异常处理器 + service 替身): /app/auth 注册与登录、目录四条路由、播放票据 FREE 与 COIN_REQUIRED 的字段形态 - 业务规则(真 service + 替身 Mapper): EMAIL 免码不走验证码且 verified=0、PHONE 必须带码、验证码错/过期被拒、 密码强度、注册频控 429、账号重复 200001、密码错误 100000、封禁 100001、 免费/已购/未解锁/无片源四个播放分支 - 依赖只加到 fruitshorts-app-api(spring-boot-starter-test,test scope),不动其它模块 - 测试放在接入层模块,避免动 01-08 冻结模块目录;只新增测试,未改业务逻辑 - 实测:mvn test BUILD SUCCESS,app-api Tests run: 37, Failures: 0, Errors: 0; mvn -DskipTests package 仍 BUILD SUCCESS
This commit is contained in:
1 parent
84aa0e17dd
commit
fafadfc6ec
8 files changed
+959
No files matched your search
@@ -39,6 +39,12 @@
|
||||
<groupId>com.fruitshorts</groupId>
|
||||
<artifactId>fruitshorts-module-commerce</artifactId>
|
||||
</dependency>
|
||||
<!-- 契约测试用:MockMvc + Mockito + JUnit5,test scope,不进运行态依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
Reference in new issue
Block a user