feat: 修改从gitea上获取配置的逻辑
All checks were successful
Redis序列化结构检查 / redis-schema-check (push) Has been skipped
All checks were successful
Redis序列化结构检查 / redis-schema-check (push) Has been skipped
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.codechecker.redis.report;
|
||||
|
||||
import com.codechecker.redis.diff.ChangeType;
|
||||
import com.codechecker.redis.diff.SchemaChange;
|
||||
import com.codechecker.redis.diff.Severity;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class ReportBuilderTest {
|
||||
|
||||
@Test
|
||||
void markdownTemplateWithoutModeAndSummary() {
|
||||
CheckReport report = new CheckReport();
|
||||
report.setRepository("jnpf-java-cloud");
|
||||
report.setBranch("code/redis_change_detection_v1.0");
|
||||
report.setOldSha("cedd161c");
|
||||
report.setNewSha("67c8a6eb");
|
||||
report.setModifier("dongzi");
|
||||
report.setModifyTime("2026-07-13 16:54:17");
|
||||
report.setMode("notify");
|
||||
|
||||
SchemaChange change = new SchemaChange(ChangeType.FIELD_REMOVED);
|
||||
change.setSeverity(Severity.P0);
|
||||
change.setKeyPattern("saas:period-config:migration:current");
|
||||
change.setWriteLocation("SaasPeriodConfigMigrationRedisSupport#putCurrent:41");
|
||||
change.setMessage("删除字段 lastError1");
|
||||
report.getChanges().add(change);
|
||||
|
||||
String md = new ReportBuilder("[Redis数据结构变更]").toMarkdown(report);
|
||||
|
||||
assertTrue(md.startsWith("## [Redis数据结构变更] jnpf-java-cloud"));
|
||||
assertTrue(md.contains("> **分支**: code/redis_change_detection_v1.0"));
|
||||
assertTrue(md.contains("> **提交**: cedd161c → 67c8a6eb"));
|
||||
assertTrue(md.contains("> **提交人**: dongzi"));
|
||||
assertTrue(md.contains("> **时间**: 2026-07-13 16:54:17"));
|
||||
assertTrue(md.contains(" - **位置**: SaasPeriodConfigMigrationRedisSupport#putCurrent:41"));
|
||||
assertTrue(md.contains(" - **删除字段**: lastError1"));
|
||||
assertFalse(md.contains("模式"));
|
||||
assertFalse(md.contains("汇总"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user