Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import jakarta.ws.rs.core.Response;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand All @@ -39,6 +40,7 @@
import org.apache.polaris.core.admin.model.StorageConfigInfo;
import org.apache.polaris.service.TestServices;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
Expand All @@ -47,7 +49,6 @@ public class PolarisOverlappingTableTest {

private static final String namespace = "ns";
private static final String catalog = "test-catalog";
private static final String baseLocation = "file:///tmp/PolarisOverlappingTableTest";

private int createTable(TestServices services, String location) {
CreateTableRequest createTableRequest =
Expand Down Expand Up @@ -120,9 +121,15 @@ static Stream<Arguments> testTableLocationRestrictions() {
void testTableLocationRestrictions(
Map<String, Object> serverConfig,
Map<String, String> catalogConfig,
int expectedStatusForOverlaps) {
int expectedStatusForOverlaps,
@TempDir Path tempDir) {
TestServices services = TestServices.builder().config(serverConfig).build();

String baseLocation = tempDir.toAbsolutePath().toUri().toString();
if (baseLocation.endsWith("/")) {
baseLocation = baseLocation.substring(0, baseLocation.length() - 1);
}

CatalogProperties.Builder propertiesBuilder =
CatalogProperties.builder()
.setDefaultBaseLocation(String.format("%s/%s", baseLocation, catalog))
Expand Down
Loading