为什么:红线第 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
59 lines
2.1 KiB
XML
59 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||
<modelVersion>4.0.0</modelVersion>
|
||
|
||
<parent>
|
||
<groupId>com.fruitshorts</groupId>
|
||
<artifactId>fruitshorts</artifactId>
|
||
<version>1.0.0-SNAPSHOT</version>
|
||
</parent>
|
||
|
||
<artifactId>fruitshorts-app-api</artifactId>
|
||
<name>fruitshorts-app-api</name>
|
||
<description>客户端接入层:/app/**</description>
|
||
|
||
<dependencies>
|
||
<dependency>
|
||
<groupId>com.fruitshorts</groupId>
|
||
<artifactId>fruitshorts-module-content</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>com.fruitshorts</groupId>
|
||
<artifactId>fruitshorts-module-media</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>com.fruitshorts</groupId>
|
||
<artifactId>fruitshorts-module-user</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>com.fruitshorts</groupId>
|
||
<artifactId>fruitshorts-module-playback</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>com.fruitshorts</groupId>
|
||
<artifactId>fruitshorts-module-interaction</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<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>
|
||
<plugins>
|
||
<plugin>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||
</plugin>
|
||
</plugins>
|
||
</build>
|
||
</project>
|