eric-maynard commented on code in PR #1586: URL: https://github.com/apache/polaris/pull/1586#discussion_r2093651812
########## polaris-core/src/test/java/org/apache/polaris/service/storage/StorageLocationTest.java: ########## @@ -19,17 +19,41 @@ package org.apache.polaris.service.storage; import org.apache.polaris.core.storage.StorageLocation; -import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class StorageLocationTest { @Test - public void testOfDifferentPrefixes() { - StorageLocation StandardLocation = StorageLocation.of("file:///path/to/file"); + public void testAwsLocations() { + StorageLocation baseStorageLocation = StorageLocation.of("s3://path/to/file"); + StorageLocation testStorageLocation = StorageLocation.of("s3://path/to/////file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + testStorageLocation = StorageLocation.of("s3://////path/////to///file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + + testStorageLocation = StorageLocation.of("s3://////path'/////*to===///\"file"); + Assertions.assertEquals("s3://path'/*to===/\"file", testStorageLocation.toString()); + } + + @Test + public void testGcpLocations() { + StorageLocation baseStorageLocation = StorageLocation.of("gcs://path/to/file"); + StorageLocation testStorageLocation = StorageLocation.of("gcs://path/to/////file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + testStorageLocation = StorageLocation.of("gcs://////path/////to///file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + + testStorageLocation = StorageLocation.of("gcs://////path'/////*to===///\"file"); + Assertions.assertEquals("gcs://path'/*to===/\"file", testStorageLocation.toString()); Review Comment: See my comment above -- is this actually correct? ########## polaris-core/src/test/java/org/apache/polaris/service/storage/StorageLocationTest.java: ########## @@ -19,17 +19,41 @@ package org.apache.polaris.service.storage; import org.apache.polaris.core.storage.StorageLocation; -import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class StorageLocationTest { @Test - public void testOfDifferentPrefixes() { - StorageLocation StandardLocation = StorageLocation.of("file:///path/to/file"); + public void testAwsLocations() { + StorageLocation baseStorageLocation = StorageLocation.of("s3://path/to/file"); + StorageLocation testStorageLocation = StorageLocation.of("s3://path/to/////file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + testStorageLocation = StorageLocation.of("s3://////path/////to///file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + + testStorageLocation = StorageLocation.of("s3://////path'/////*to===///\"file"); + Assertions.assertEquals("s3://path'/*to===/\"file", testStorageLocation.toString()); + } + + @Test + public void testGcpLocations() { + StorageLocation baseStorageLocation = StorageLocation.of("gcs://path/to/file"); + StorageLocation testStorageLocation = StorageLocation.of("gcs://path/to/////file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + testStorageLocation = StorageLocation.of("gcs://////path/////to///file"); + Assertions.assertEquals(testStorageLocation, baseStorageLocation); + + testStorageLocation = StorageLocation.of("gcs://////path'/////*to===///\"file"); + Assertions.assertEquals("gcs://path'/*to===/\"file", testStorageLocation.toString()); Review Comment: How does it work right now in Polaris? -- 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