vrajat commented on code in PR #15515: URL: https://github.com/apache/pinot/pull/15515#discussion_r2073213535
########## pinot-controller/src/test/java/org/apache/pinot/controller/api/resources/PinotLogicalTableResourceTest.java: ########## @@ -0,0 +1,309 @@ +/** + * 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.pinot.controller.api.resources; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import org.apache.pinot.controller.helix.ControllerTest; +import org.apache.pinot.spi.data.LogicalTableConfig; +import org.apache.pinot.spi.utils.builder.ControllerRequestURLBuilder; +import org.testng.annotations.AfterClass; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; + + +public class PinotLogicalTableResourceTest extends ControllerTest { + + private static final String LOGICAL_TABLE_NAME = "test_logical_table"; + public static final String BROKER_TENANT = "DefaultTenant"; + protected ControllerRequestURLBuilder _controllerRequestURLBuilder; + + @BeforeClass + public void setUpClass() + throws Exception { + startZk(); + startController(); + addFakeBrokerInstancesToAutoJoinHelixCluster(1, true); + addFakeServerInstancesToAutoJoinHelixCluster(1, true); + _controllerRequestURLBuilder = getControllerRequestURLBuilder(); + } + + @AfterClass + public void tearDownClass() { + stopController(); + stopZk(); + } + + @AfterMethod + public void tearDown() { + // cleans up the physical tables after each testcase + cleanup(); + } + + @DataProvider + public Object[][] tableNamesProvider() { + return new Object[][]{ + {"test_logical_table", List.of("test_table_1", "test_table_2"), List.of("test_table_3")}, + {"test_logical_table", List.of("test_table_1", "db.test_table_2"), List.of("test_table_3")}, + {"test_logical_table", List.of("test_table_1", "test_table_2"), List.of("db.test_table_3")}, + {"test_logical_table", List.of("db.test_table_1", "db.test_table_2"), List.of("db.test_table_3")}, + {"db.test_logical_table", List.of("test_table_1", "test_table_2"), List.of("test_table_3")}, + {"db.test_logical_table", List.of("test_table_1", "db.test_table_2"), List.of("test_table_3")}, + {"db.test_logical_table", List.of("test_table_1", "test_table_2"), List.of("db.test_table_3")}, + {"db.test_logical_table", List.of("db.test_table_1", "db.test_table_2"), List.of("db.test_table_3")}, Review Comment: can you add a test in CRUD PR where the logical table name and a physical table name is the same BUT in different databases ? -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org