2424import static org .assertj .core .api .Assertions .assertThat ;
2525
2626import jakarta .ws .rs .core .Response ;
27+ import java .nio .file .Path ;
2728import java .util .List ;
2829import java .util .Map ;
2930import java .util .UUID ;
3940import org .apache .polaris .core .admin .model .StorageConfigInfo ;
4041import org .apache .polaris .service .TestServices ;
4142import org .junit .jupiter .api .DisplayName ;
43+ import org .junit .jupiter .api .io .TempDir ;
4244import org .junit .jupiter .params .ParameterizedTest ;
4345import org .junit .jupiter .params .provider .Arguments ;
4446import org .junit .jupiter .params .provider .MethodSource ;
@@ -47,7 +49,6 @@ public class PolarisOverlappingTableTest {
4749
4850 private static final String namespace = "ns" ;
4951 private static final String catalog = "test-catalog" ;
50- private static final String baseLocation = "file:///tmp/PolarisOverlappingTableTest" ;
5152
5253 private int createTable (TestServices services , String location ) {
5354 CreateTableRequest createTableRequest =
@@ -120,9 +121,15 @@ static Stream<Arguments> testTableLocationRestrictions() {
120121 void testTableLocationRestrictions (
121122 Map <String , Object > serverConfig ,
122123 Map <String , String > catalogConfig ,
123- int expectedStatusForOverlaps ) {
124+ int expectedStatusForOverlaps ,
125+ @ TempDir Path tempDir ) {
124126 TestServices services = TestServices .builder ().config (serverConfig ).build ();
125127
128+ String baseLocation = tempDir .toAbsolutePath ().toUri ().toString ();
129+ if (baseLocation .endsWith ("/" )) {
130+ baseLocation = baseLocation .substring (0 , baseLocation .length () - 1 );
131+ }
132+
126133 CatalogProperties .Builder propertiesBuilder =
127134 CatalogProperties .builder ()
128135 .setDefaultBaseLocation (String .format ("%s/%s" , baseLocation , catalog ))
0 commit comments