29445c6825
- 新增接入 WAL、检查点、背压恢复及可靠分发机制,完善 Kafka 幂等发布、分区、重试、DLT 和补偿流程 - 引入规则预编译、批内快照及 JetCache/Caffeine 两级缓存,支持缓存失效广播、影子对账和执行指标 - 升级 InfluxDB V2 原始日志模型,统一接收时间与 Point 时间,支持按日 measurement、UUID 分桶及 V1/V2 双读 - 重构达梦标准化批量写入与统计链路,支持事务内直写、增量投影、幂等控制、窗口水位和日期切换 - 完善告警处理、配置校验、运行监控及测试覆盖
27 lines
1.0 KiB
Java
27 lines
1.0 KiB
Java
package com.common.service;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
|
|
|
class FactWriteOwnershipGuardTest {
|
|
|
|
@Test
|
|
void legacyModeKeepsRollbackWritePathAvailable() {
|
|
FactWriteOwnershipGuard guard = new FactWriteOwnershipGuard("LEGACY_CHANGE_LOG");
|
|
assertDoesNotThrow(() -> guard.assertLocalFactWriteAllowed("test"));
|
|
}
|
|
|
|
@Test
|
|
void directModesRejectWritesThatWouldBypassRuleTransaction() {
|
|
assertThrows(IllegalStateException.class,
|
|
() -> new FactWriteOwnershipGuard("DIRECT").assertLocalFactWriteAllowed("test"));
|
|
assertThrows(IllegalStateException.class,
|
|
() -> new FactWriteOwnershipGuard("DIRECT_SHADOW").assertLocalFactWriteAllowed("test"));
|
|
assertThrows(IllegalStateException.class,
|
|
() -> new FactWriteOwnershipGuard("FACT_ONLY_REBUILD_REQUIRED")
|
|
.assertLocalFactWriteAllowed("test"));
|
|
}
|
|
}
|