rdblue commented on a change in pull request #4467: URL: https://github.com/apache/iceberg/pull/4467#discussion_r840962261
########## File path: core/src/test/java/org/apache/iceberg/rest/TestResourcePaths.java ########## @@ -0,0 +1,149 @@ +/* + * 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.iceberg.rest; + +import org.apache.iceberg.catalog.Namespace; +import org.apache.iceberg.catalog.TableIdentifier; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; +import org.junit.Assert; +import org.junit.Test; + +public class TestResourcePaths { + private final String prefix = "ws/catalog"; + private final ResourcePaths withPrefix = ResourcePaths.forCatalogProperties(ImmutableMap.of("prefix", prefix)); + private final ResourcePaths withoutPrefix = ResourcePaths.forCatalogProperties(ImmutableMap.of()); + + @Test + public void testConfigPath() { + // prefix does not affect the config route because config is merged into catalog properties + Assert.assertEquals(ResourcePaths.config(), "v1/config"); + } Review comment: The reason why we don't support prefix like that right now is that we need an original config route, which may send back a `prefix`. We could add what you're talking about later, but we'd need to create an initial `ResourcePaths` and then a new one with the config that it returns. I think we should stick to the simple version for now and we can extend it later. -- 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]
