imbajin commented on code in PR #3185:
URL: https://github.com/apache/hugegraph/pull/3185#discussion_r3935589583


##########
hugegraph-pd/hg-pd-test/src/main/java/org/apache/hugegraph/pd/rest/interceptor/AuthenticationConfigurerTest.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hugegraph.pd.rest.interceptor;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.util.AntPathMatcher;
+import org.springframework.util.PathMatcher;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.handler.MappedInterceptor;
+
+import static org.mockito.Mockito.mock;
+
+/**
+ * The probe endpoints have to stay outside the auth interceptor. If one of 
them slips back
+ * behind it, PD answers a probe with 200 and an error envelope instead of a 
readiness
+ * answer, so every healthcheck gating on the body holds forever while the 
status still
+ * looks fine. That failure is silent, hence a check here rather than only in 
the live
+ * REST suite.
+ */
+public class AuthenticationConfigurerTest {
+
+    private static final PathMatcher MATCHER = new AntPathMatcher();
+
+    /**
+     * {@code InterceptorRegistry.getInterceptors()} is protected, so read it 
from a subclass.
+     */
+    private static final class TestRegistry extends InterceptorRegistry {
+
+        List<Object> registered() {
+            return getInterceptors();
+        }
+    }
+
+    private static MappedInterceptor authInterceptor() {
+        AuthenticationConfigurer configurer = new AuthenticationConfigurer();

Review Comment:
   ‼️ This new test does not compile in the selected CI build. Run 33839755062 
fails in hg-pd-test with `cannot find symbol` for `AuthenticationConfigurer` 
and `RestAuthentication` at lines 53-54; the same failure appears in both macOS 
server jobs. Both classes are defined under hg-pd-service, but this test is 
compiled in hg-pd-test. Please move this test into the service test module or 
make the service classes available in hg-pd-test's compile path, then rerun the 
PD/server CI.



-- 
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