adnanhemani commented on code in PR #1604: URL: https://github.com/apache/polaris/pull/1604#discussion_r2098578243
########## polaris-core/src/test/java/org/apache/polaris/service/storage/StorageLocationTest.java: ########## @@ -18,18 +18,63 @@ */ package org.apache.polaris.service.storage; +import java.net.URISyntaxException; import org.apache.polaris.core.storage.StorageLocation; +import org.apache.polaris.core.storage.azure.AzureLocation; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; public class StorageLocationTest { @Test public void testOfDifferentPrefixes() { - StorageLocation StandardLocation = StorageLocation.of("file:///path/to/file"); + StorageLocation standardLocation = StorageLocation.of("file:///path/to/file"); StorageLocation slashLeadingLocation = StorageLocation.of("/path/to/file"); + StorageLocation manySlashLeadingLocation = StorageLocation.of("////////path/to/file"); StorageLocation fileSingleSlashLocation = StorageLocation.of("file:/path/to/file"); - Assertions.assertThat(slashLeadingLocation.equals(StandardLocation)).isTrue(); - Assertions.assertThat(fileSingleSlashLocation.equals(StandardLocation)).isTrue(); + StorageLocation fileTooManySlashesLocation = StorageLocation.of("file://///////path/to/file"); + Assertions.assertThat(slashLeadingLocation.equals(standardLocation)).isTrue(); + Assertions.assertThat(manySlashLeadingLocation.equals(standardLocation)).isTrue(); + Assertions.assertThat(fileSingleSlashLocation.equals(standardLocation)).isTrue(); + Assertions.assertThat(fileTooManySlashesLocation.equals(standardLocation)).isTrue(); + Assertions.assertThat(standardLocation instanceof AzureLocation).isFalse(); Review Comment: This is a good question! `AzureLocation` is an extension of `StorageLocation` (due to Azure's very specific way of defining locations). All other locations remain instances of `StorageLocation`. So if I test that any of these locations (including an instance of AzureLocation) are an instance of `StorageLocation`, they'll always return true. This test is basically just testing that we are not creating `AzureLocation` subclassed objects for these paths. -- 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: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org