Skip to content

Commit

Permalink
Test Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
N-o-Z committed Feb 26, 2024
1 parent f86dcad commit d589250
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/io/lakefs/iceberg/rest/LakeFSCatalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void initialize(String name, Map<String, String> properties) {
catalogName = name;
warehouseLocation = WAREHOUSE_LOCATION;
suppressPermissionError = Boolean.parseBoolean(properties.get(HADOOP_SUPPRESS_PERMISSION_ERROR));
// TODO (niro): Future - create a caching mechanism for FileSystem Initialization per repo
}

@Override
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/io/lakefs/iceberg/rest/TestLakeFSFileIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockserver.matchers.Times;
import static org.mockserver.model.HttpResponse.response;

import io.lakefs.clients.sdk.model.StorageConfig;

public class TestLakeFSFileIO extends FSTestBase {

Expand All @@ -15,6 +19,21 @@ public class TestLakeFSFileIO extends FSTestBase {

@Before
public void setUp(){
// lakeFSFS initialization requires a blockstore.
mockServerClient.when(request()
.withMethod("GET")
.withPath("/config/storage"),
Times.unlimited())
.respond(response()
.withStatusCode(200)
.withBody(gson.toJson(new StorageConfig()
.blockstoreType("s3")
.blockstoreNamespaceExample("/not/really")
.blockstoreNamespaceValidityRegex(".*")
.preSignSupport(false)
.preSignSupportUi(false)
.importSupport(false)
.importValidityRegex(".*"))));
lakeFSFileIO = new LakeFSFileIO(lakeFSRepo, lakeFSRef, conf);
}

Expand Down

0 comments on commit d589250

Please sign in to comment.