NihalJain commented on code in PR #17295: URL: https://github.com/apache/pinot/pull/17295#discussion_r2584871527
########## pinot-spi/src/test/java/org/apache/pinot/spi/utils/builder/UserConfigBuilderTest.java: ########## @@ -0,0 +1,261 @@ +/** + * 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.spi.utils.builder; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.pinot.spi.config.user.AccessType; +import org.apache.pinot.spi.config.user.ComponentType; +import org.apache.pinot.spi.config.user.RoleType; +import org.apache.pinot.spi.config.user.UserConfig; +import org.testng.Assert; +import org.testng.annotations.Test; + + +/** + * Tests for {@link UserConfigBuilder} + */ +public class UserConfigBuilderTest { + + private static final String TEST_USERNAME = "testUser"; + private static final String TEST_PASSWORD = "testPassword"; + + @Test + public void testBasicUserConfigBuild() { + UserConfig userConfig = new UserConfigBuilder() + .setUsername(TEST_USERNAME) + .setPassword(TEST_PASSWORD) + .setComponentType(ComponentType.BROKER) + .setRoleType(RoleType.USER) + .build(); + + Assert.assertNotNull(userConfig, "UserConfig should not be null"); + Assert.assertEquals(userConfig.getUserName(), TEST_USERNAME, "Username should match"); + Assert.assertEquals(userConfig.getPassword(), TEST_PASSWORD, "Password should match"); + Assert.assertEquals(userConfig.getComponentType(), ComponentType.BROKER, "Component type should match"); + Assert.assertEquals(userConfig.getRoleType(), RoleType.USER, "Role type should match"); + Assert.assertNull(userConfig.getTables(), "Tables should be null when not set"); + Assert.assertNull(userConfig.getExcludeTables(), "Exclude tables should be null when not set"); + Assert.assertNull(userConfig.getPermissios(), "Permissions should be null when not set"); Review Comment: typo in method name, raised https://github.com/apache/pinot/issues/17307 for fix -- 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]
