From 34981c30a78e8bbd7791131059a9210f9928b62c Mon Sep 17 00:00:00 2001
From: 刘光辉 <347230014@qq.com>
Date: 星期四, 17 九月 2026 09:24:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master
---
jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/AuditLogEntityColumnProbe.java | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/AuditLogEntityColumnProbe.java b/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/AuditLogEntityColumnProbe.java
new file mode 100644
index 0000000..b7cc74c
--- /dev/null
+++ b/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/AuditLogEntityColumnProbe.java
@@ -0,0 +1,39 @@
+package jnpf.limsService.support;
+
+import jnpf.audit.sdk.aspect.AuditLogAspect;
+import jnpf.limsEntity.LimsQingyandanEntity;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+/** Verifies that layer-2 entity snapshots use physical database column names. */
+public final class AuditLogEntityColumnProbe {
+
+ private AuditLogEntityColumnProbe() {
+ }
+
+ @SuppressWarnings("unchecked")
+ public static void main(String[] args) throws Exception {
+ LimsQingyandanEntity entity = new LimsQingyandanEntity();
+ entity.setId("row-1");
+ entity.setBizStatus("confirmed");
+ entity.setBizSign("sign-reference");
+
+ Method mapper = AuditLogAspect.class.getDeclaredMethod("entityToColumnMap", Object.class);
+ mapper.setAccessible(true);
+ Map<String, Object> columns = (Map<String, Object>) mapper.invoke(null, entity);
+
+ check("row-1".equals(columns.get("f_id")), "@TableId f_id");
+ check("confirmed".equals(columns.get("biz_status")), "@TableField biz_status");
+ check("sign-reference".equals(columns.get("biz_sign")), "diff value is not masked");
+ check(!columns.containsKey("bizStatus") && !columns.containsKey("bizSign"),
+ "Java property names must not leak into field_diffs");
+ System.out.println("AuditLogEntityColumnProbe: all checks passed");
+ }
+
+ private static void check(boolean condition, String name) {
+ if (!condition) {
+ throw new AssertionError(name);
+ }
+ }
+}
--
Gitblit v1.8.0