forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vertx: make the address in ConsumeEvent annotation configurable
- resolves quarkusio#36851
- Loading branch information
Showing
5 changed files
with
171 additions
and
2 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
...ment/src/test/java/io/quarkus/vertx/deployment/ConsumerNonexistingConfigPropertyTest.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,43 @@ | ||
package io.quarkus.vertx.deployment; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.runtime.util.ExceptionUtil; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.quarkus.vertx.ConsumeEvent; | ||
import io.vertx.mutiny.core.eventbus.Message; | ||
|
||
public class ConsumerNonexistingConfigPropertyTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot(root -> root.addClasses(MessageConsumers.class)) | ||
.assertException(t -> { | ||
Throwable root = ExceptionUtil.getRootCause(t); | ||
assertTrue( | ||
root.getMessage().contains( | ||
"Could not expand value address.does.not.exist in property ${address.does.not.exist}"), | ||
t.toString()); | ||
}); | ||
|
||
@Test | ||
public void test() throws InterruptedException { | ||
fail(); | ||
} | ||
|
||
@ApplicationScoped | ||
static class MessageConsumers { | ||
|
||
@ConsumeEvent("${address.does.not.exist}") | ||
void pub(Message<String> name) { | ||
} | ||
|
||
} | ||
|
||
} |
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
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
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