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.
Reactive Messaging: check if @Blocking is used with one of (Outgoing,…
… Incoming) fixes quarkusio#8567
- Loading branch information
1 parent
7894a22
commit 729ace8
Showing
2 changed files
with
46 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
...arkus/smallrye/reactivemessaging/blocking/BlockingWithoutOutgoingOnIncomingErrorTest.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,40 @@ | ||
package io.quarkus.smallrye.reactivemessaging.blocking; | ||
|
||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.enterprise.inject.spi.DeploymentException; | ||
import javax.inject.Inject; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.smallrye.reactive.messaging.annotations.Blocking; | ||
|
||
public class BlockingWithoutOutgoingOnIncomingErrorTest { | ||
|
||
@Inject | ||
BeanWithBlocking referenceToForceArcToUseTheBean; | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(BeanWithBlocking.class)) | ||
.setExpectedException(DeploymentException.class); | ||
|
||
@Test | ||
public void runTest() { | ||
fail("The expected DeploymentException was not thrown"); | ||
} | ||
|
||
@ApplicationScoped | ||
public static class BeanWithBlocking { | ||
@Blocking | ||
public String blockingMethod(String foo) { | ||
return foo + "1"; | ||
} | ||
} | ||
} |