imbajin commented on code in PR #2912:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2912#discussion_r2554944559


##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/auth/HugeGraphAuthProxy.java:
##########
@@ -953,6 +954,14 @@ public void updateTime(Date updateTime) {
         this.hugegraph.updateTime(updateTime);
     }
 
+    public static String username() {

Review Comment:
   ⚠️ **Important: 缺少单元测试**
   
   这是一个 NPE 修复,应该添加单元测试来验证:
   
   1. 非认证模式下调用 `username()` 的行为
   2. `getContext()` 返回 null 时的处理
   3. 各个调用方(ManagerAPI, GraphsAPI, GraphSpaceAPI)在非认证模式下的正确性
   
   建议添加测试类或测试方法覆盖这些场景。



##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/auth/HugeGraphAuthProxy.java:
##########
@@ -953,6 +954,14 @@ public void updateTime(Date updateTime) {
         this.hugegraph.updateTime(updateTime);
     }
 
+    public static String username() {

Review Comment:
   🧹 **Minor: 方法位置不当**
   
   新增的 `username()` 方法放在了 `ProxyHugeGraph` 内部类的末尾,建议移到外部类 `HugeGraphAuthProxy` 
的静态方法区域(靠近 `getContext()` 方法),这样更符合代码组织逻辑。
   
   当前位置在 line 957-962,建议移动到 line 195 附近(getContext() 方法之后)。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to