Skip to content

Commit

Permalink
Document configuration and default values (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsimsek authored Feb 24, 2025
1 parent bb6a528 commit 46d536d
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import io.quarkus.runtime.annotations.ConfigRoot;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import io.smallrye.config.WithParentName;
import org.jboss.logging.Logger;

@ConfigRoot
@ConfigMapping
Expand All @@ -14,4 +17,8 @@ public interface GlobalConfig {
@WithParentName
DebeziumConfig debezium();

@WithName("quarkus.log.level")
@WithDefault("INFO")
Logger.Level quarkusLogLevel();

}
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ public interface IcebergConfig {
@WithDefault("true")
boolean allowFieldAddition();

@WithName("debezium.sink.iceberg.io-impl")
@WithDefault("org.apache.iceberg.io.ResolvingFileIO")
String ioImpl();

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
package io.debezium.server.iceberg;

import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.Map;

import static io.debezium.server.iceberg.TestConfigSource.ICEBERG_CATALOG_NAME;
import static io.debezium.server.iceberg.TestConfigSource.ICEBERG_WAREHOUSE_S3A;

@QuarkusTest
@TestProfile(GlobalConfigTest.TestProfile.class)
public class GlobalConfigTest {

@Inject
Expand All @@ -26,6 +33,16 @@ void configLoadsCorrectly() {
Assertions.assertTrue(conf.iceberg().icebergConfigs().containsKey("table-namespace"));
Assertions.assertTrue(conf.iceberg().icebergConfigs().containsKey("catalog-name"));
Assertions.assertTrue(conf.iceberg().icebergConfigs().containsValue(ICEBERG_CATALOG_NAME));
Assertions.assertEquals(Logger.Level.ERROR, conf.quarkusLogLevel());
}

public static class TestProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
Map<String, String> config = new HashMap<>();
config.put("quarkus.log.level", "ERROR");
return config;
}
}

}
Loading

0 comments on commit 46d536d

Please sign in to comment.