24
24
import static org .assertj .core .api .Assertions .assertThat ;
25
25
26
26
import jakarta .ws .rs .core .Response ;
27
+ import java .nio .file .Path ;
27
28
import java .util .List ;
28
29
import java .util .Map ;
29
30
import java .util .UUID ;
39
40
import org .apache .polaris .core .admin .model .StorageConfigInfo ;
40
41
import org .apache .polaris .service .TestServices ;
41
42
import org .junit .jupiter .api .DisplayName ;
43
+ import org .junit .jupiter .api .io .TempDir ;
42
44
import org .junit .jupiter .params .ParameterizedTest ;
43
45
import org .junit .jupiter .params .provider .Arguments ;
44
46
import org .junit .jupiter .params .provider .MethodSource ;
@@ -47,7 +49,6 @@ public class PolarisOverlappingTableTest {
47
49
48
50
private static final String namespace = "ns" ;
49
51
private static final String catalog = "test-catalog" ;
50
- private static final String baseLocation = "file:///tmp/PolarisOverlappingTableTest" ;
51
52
52
53
private int createTable (TestServices services , String location ) {
53
54
CreateTableRequest createTableRequest =
@@ -120,9 +121,15 @@ static Stream<Arguments> testTableLocationRestrictions() {
120
121
void testTableLocationRestrictions (
121
122
Map <String , Object > serverConfig ,
122
123
Map <String , String > catalogConfig ,
123
- int expectedStatusForOverlaps ) {
124
+ int expectedStatusForOverlaps ,
125
+ @ TempDir Path tempDir ) {
124
126
TestServices services = TestServices .builder ().config (serverConfig ).build ();
125
127
128
+ String baseLocation = tempDir .toAbsolutePath ().toUri ().toString ();
129
+ if (baseLocation .endsWith ("/" )) {
130
+ baseLocation = baseLocation .substring (0 , baseLocation .length () - 1 );
131
+ }
132
+
126
133
CatalogProperties .Builder propertiesBuilder =
127
134
CatalogProperties .builder ()
128
135
.setDefaultBaseLocation (String .format ("%s/%s" , baseLocation , catalog ))
0 commit comments