-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a config property to disable the VertxCurrentContextFactory
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxBuildConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.vertx.deployment; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
|
||
@ConfigRoot(name = "vertx", phase = ConfigPhase.BUILD_TIME) | ||
public class VertxBuildConfig { | ||
|
||
/** | ||
* If set to {@code true} then a customized current context factory (backed by a Vert.x duplicated local context) is used | ||
* for normal scopes in ArC. | ||
*/ | ||
@ConfigItem(generateDocumentation = false, defaultValue = "true") | ||
public boolean customizeArcContext; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...uarkus/vertx/deployment/currentcontextfactory/VertxCurrentContextFactoryDisabledTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.quarkus.vertx.deployment.currentcontextfactory; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.arc.Arc; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.quarkus.vertx.runtime.VertxCurrentContextFactory; | ||
|
||
public class VertxCurrentContextFactoryDisabledTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.overrideConfigKey("quarkus.vertx.customize-arc-context", "false"); | ||
|
||
@Test | ||
public void testCustomizedFactoryNotUsed() { | ||
assertFalse(Arc.container().getCurrentContextFactory() instanceof VertxCurrentContextFactory); | ||
} | ||
|
||
} |