Skip to content

Commit

Permalink
LoggingConfigTest
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba committed Jan 7, 2025
1 parent 3cd83ac commit 9155956
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.arc.test;

import org.eclipse.microprofile.config.ConfigProvider;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.builder.BuildContext;
import io.quarkus.builder.BuildStep;
import io.quarkus.deployment.builditem.RunTimeConfigurationDefaultBuildItem;
import io.quarkus.test.QuarkusUnitTest;

public class LoggingConfigTest {

@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest()
.withEmptyApplication()
.addBuildChainCustomizer(b -> {
b.addBuildStep(new BuildStep() {
@Override
public void execute(BuildContext context) {
context.produce(new RunTimeConfigurationDefaultBuildItem("quarkus.log.console.enable", "false"));
}
}).produces(RunTimeConfigurationDefaultBuildItem.class).build();
});

@Test
public void testConsoleLogging() {
System.out.println(ConfigProvider.getConfig().getConfigValue("quarkus.log.console.enable"));
}

}

0 comments on commit 9155956

Please sign in to comment.