MehulBatra commented on code in PR #1372: URL: https://github.com/apache/fluss/pull/1372#discussion_r2261104122
########## fluss-lake/fluss-lake-iceberg/src/test/java/com/apache/fluss/lake/iceberg/catalog/IcebergLakeCatalogTest.java: ########## @@ -0,0 +1,334 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.apache.fluss.lake.iceberg.catalog; + +import com.alibaba.fluss.config.Configuration; +import com.alibaba.fluss.lake.iceberg.IcebergLakeCatalog; +import com.alibaba.fluss.metadata.Schema; +import com.alibaba.fluss.metadata.TableDescriptor; +import com.alibaba.fluss.metadata.TablePath; +import com.alibaba.fluss.types.DataTypes; + +import org.apache.iceberg.PartitionSpec; +import org.apache.iceberg.SortOrder; +import org.apache.iceberg.Table; +import org.apache.iceberg.catalog.Catalog; +import org.apache.iceberg.catalog.Namespace; +import org.apache.iceberg.catalog.SupportsNamespaces; +import org.apache.iceberg.catalog.TableIdentifier; +import org.apache.iceberg.inmemory.InMemoryCatalog; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; +import org.apache.iceberg.types.Types; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import static com.alibaba.fluss.metadata.TableDescriptor.BUCKET_COLUMN_NAME; +import static com.alibaba.fluss.metadata.TableDescriptor.OFFSET_COLUMN_NAME; +import static com.alibaba.fluss.metadata.TableDescriptor.TIMESTAMP_COLUMN_NAME; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; + +/** Unit test for {@link IcebergLakeCatalog}. */ +class IcebergLakeCatalogTest { + + @TempDir private File tempWarehouseDir; + + private Configuration configuration; + private Catalog icebergCatalog; + private SupportsNamespaces namespaceSupport; + private IcebergLakeCatalog flussIcebergCatalog; + + @BeforeEach + void setupCatalog() { + configuration = new Configuration(); + configuration.setString("warehouse", tempWarehouseDir.toURI().toString()); + + InMemoryCatalog inMemoryCatalog = new InMemoryCatalog(); + inMemoryCatalog.initialize( + "test_catalog", ImmutableMap.of("warehouse", tempWarehouseDir.toURI().toString())); + + this.icebergCatalog = inMemoryCatalog; + this.namespaceSupport = inMemoryCatalog; + this.flussIcebergCatalog = new IcebergLakeCatalog(inMemoryCatalog); Review Comment: Thanks for the lead @VisibleForTesting did help! -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
