imbajin commented on code in PR #2966: URL: https://github.com/apache/hugegraph/pull/2966#discussion_r2917494522
########## hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/api/GraphSpaceApiStandaloneTest.java: ########## @@ -0,0 +1,86 @@ +/* + * 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.api; + +import java.util.Map; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import jakarta.ws.rs.core.Response; + +/** + * Tests that GraphSpaceAPI returns a friendly HTTP 400 error in standalone + * mode (i.e. when the server is started without PD / hstore backend). + * <p> + * This class intentionally does NOT have a class-level Assume guard so that + * the tests are actually executed in non-hstore CI runs. + */ +public class GraphSpaceApiStandaloneTest extends BaseApiTest { + + private static final String PATH = "graphspaces"; + private static final String STANDALONE_ERROR = + "GraphSpace management is not supported in standalone mode"; + + @Before + public void skipForPdMode() { + assumeStandaloneMode(); + } + + @Test Review Comment: ‼️ The standalone suite still doesn't cover `/graphspaces/profile`, and `GraphSpaceAPI#listProfile()` remains unguarded on the current head. That means this PR can still pass while one GraphSpace endpoint returns a different standalone behavior than the others. Please add a profile assertion here and guard `listProfile()` the same way as the rest of the GraphSpace endpoints. ```suggestion @Test public void testProfileReturnsFriendlyError() { Response r = this.client().get(PATH + "/profile"); String content = assertResponseStatus(400, r); Assert.assertTrue(content.contains(STANDALONE_ERROR)); } @Test ``` -- 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]
