对平(两条既有台账红): 迁移盘点文档补 V156 一跳、页码台账按拼写分开登记
出包前实测 master 头全量红在这两条上(都不是本批引入,已在干净 HEAD worktree 复跑坐实): 1. docs/migration-inventory.md:磁盘 154 支版本化迁移、整数版本到 V156,文档还停在 153 / V1..V155,"最新版本"一行也没写 V156 的文件名 ⇒ CompanyMigrationV143Test 的三条对账(文件数/范围/含最新文件名)红。取号起点 V157 本来就对,没动。 旧版文件名一个没挤掉(V155/V154/V153/V152 仍在链条里,CompanyDefaultDropV152Test 钉着)。 2. PageDefaultsLedgerTest:同一个断言同时套在 #page_size= 与 #pageSize= 两种拼写上, 而 camelCase 那族实际只用得到 2 种常量(另外 2 种只以 snake_case 出现)⇒ 恒红, 红的是写法不是有人新增了默认值。改成逐拼写登记 + 两拼写并集仍只许四种, "长出第五种要红"这条保护不降。 用户拍板"对平两条账后整批发",故本笔与外观那两笔同树出包。
This commit is contained in:
+17
-6
@@ -121,12 +121,23 @@ class PageDefaultsLedgerTest {
|
||||
assertThat(kindsUsing(actual, "page", "FIRST_PAGE"))
|
||||
.as("页码口径只有一套:全部从 1 起")
|
||||
.isEqualTo(21);
|
||||
for (String kind : List.of("page_size", "pageSize")) {
|
||||
assertThat(distinctConstants(actual, kind))
|
||||
.as(kind + " 的默认容量集合:15/20/50/1000 四种各自登记,新来第五种要红")
|
||||
.containsExactlyInAnyOrder("USER_LIST_PAGE_SIZE", "ADMIN_LIST_PAGE_SIZE",
|
||||
"TASK_LIST_PAGE_SIZE", "FULL_EXPORT_PAGE_SIZE");
|
||||
}
|
||||
assertThat(distinctConstants(actual, "page_size"))
|
||||
.as("page_size 的默认容量集合:15/20/50/1000 四种各自登记,新来第五种要红")
|
||||
.containsExactlyInAnyOrder("USER_LIST_PAGE_SIZE", "ADMIN_LIST_PAGE_SIZE",
|
||||
"TASK_LIST_PAGE_SIZE", "FULL_EXPORT_PAGE_SIZE");
|
||||
// 同一个语义有两种拼写(@RequestParam(name = "page_size") 与 camelCase 的 pageSize),
|
||||
// 而两种拼写实际用到的常量本来就不同。原来把同一个四项清单套在两种拼写上,
|
||||
// 红的是台账写法而不是有人新增了默认值——2026-10-10 出包前对平这一条。
|
||||
assertThat(distinctConstants(actual, "pageSize"))
|
||||
.as("pageSize 拼写目前只用得到这两种")
|
||||
.containsExactlyInAnyOrder("ADMIN_LIST_PAGE_SIZE", "USER_LIST_PAGE_SIZE");
|
||||
java.util.Set<String> bothSpellings = new java.util.TreeSet<>();
|
||||
bothSpellings.addAll(distinctConstants(actual, "page_size"));
|
||||
bothSpellings.addAll(distinctConstants(actual, "pageSize"));
|
||||
assertThat(bothSpellings)
|
||||
.as("两种拼写合起来仍只许那四种容量:谁长出第五种,这里就红")
|
||||
.containsExactlyInAnyOrderElementsOf(java.util.List.of("USER_LIST_PAGE_SIZE",
|
||||
"ADMIN_LIST_PAGE_SIZE", "TASK_LIST_PAGE_SIZE", "FULL_EXPORT_PAGE_SIZE"));
|
||||
assertThat(distinctConstants(actual, "limit"))
|
||||
.as("limit 是「本次最多返回几条」,不许和 page_size 混用同一批常量")
|
||||
.containsExactlyInAnyOrder("DEFAULT_RESULT_LIMIT", "ADMIN_SCAN_LIMIT");
|
||||
|
||||
Reference in New Issue
Block a user