This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch 3.27.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit cf9d9dde76e508a1bd645f26bdc63fcd5680ae91 Author: Viliam Kasala <[email protected]> AuthorDate: Tue Jan 20 12:27:40 2026 +0100 Enable JMS IBM MQ tests Fixes #8137 * Enable JMS IBM MQ tests #8137 * Ensure exception.queue AUTHREC PROFILE is configured correctly --------- Co-authored-by: James Netherton <[email protected]> --- integration-tests/jms-ibmmq-client/README.adoc | 6 +----- .../quarkus/component/jms/ibmmq/it/IBMMQPoolingTest.java | 5 ++--- .../camel/quarkus/component/jms/ibmmq/it/IBMMQTest.java | 5 ++--- .../camel/quarkus/component/jms/ibmmq/it/IBMMQXATest.java | 3 +-- .../component/jms/ibmmq/support/IBMMQTestResource.java | 15 ++++++++++++--- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/integration-tests/jms-ibmmq-client/README.adoc b/integration-tests/jms-ibmmq-client/README.adoc index 9d676583c6..d730fb0a38 100644 --- a/integration-tests/jms-ibmmq-client/README.adoc +++ b/integration-tests/jms-ibmmq-client/README.adoc @@ -1,7 +1,3 @@ == Running the tests -To run the tests, you need to accept the license from the official docker image for IBM MQ. - -You can run `docker run -e LICENSE=view icr.io/ibm-messaging/mq:9.3.2.1-r1` to view the license. - -If you accept the license and want to run the tests, use `-Dibm.mq.container.license=accept` property. +The tests accept IBM MQ license by default. To view the license, you can run `docker run -e LICENSE=view icr.io/ibm-messaging/mq:9.4.3.0-r1`. diff --git a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQPoolingTest.java b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQPoolingTest.java index 3bcaa6adf7..ff8e1e5604 100644 --- a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQPoolingTest.java +++ b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQPoolingTest.java @@ -30,13 +30,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import static org.hamcrest.Matchers.is; @QuarkusTest @QuarkusTestResource(IBMMQTestResource.class) -@EnabledIfSystemProperty(named = "ibm.mq.container.license", matches = "accept") @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestProfile(JmsPoolingEnabled.class) public class IBMMQPoolingTest extends AbstractJmsMessagingTest { @@ -60,7 +58,8 @@ public class IBMMQPoolingTest extends AbstractJmsMessagingTest { destinations.createQueue(method.getName() + "2"); destinations.createTopic(method.getName()); } - + destinations.createQueue("exception.queue"); + destinations.createQueue("xa"); super.startRoutes(test); } diff --git a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQTest.java b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQTest.java index dc90ff428d..2c06e1ac30 100644 --- a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQTest.java +++ b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQTest.java @@ -28,13 +28,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import static org.hamcrest.Matchers.is; @QuarkusTest @QuarkusTestResource(IBMMQTestResource.class) -@EnabledIfSystemProperty(named = "ibm.mq.container.license", matches = "accept") @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class IBMMQTest extends AbstractJmsMessagingTest { private IBMMQDestinations destinations; @@ -57,7 +55,8 @@ public class IBMMQTest extends AbstractJmsMessagingTest { destinations.createQueue(method.getName() + "2"); destinations.createTopic(method.getName()); } - + destinations.createQueue("exception.queue"); + destinations.createQueue("xa"); super.startRoutes(test); } diff --git a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQXATest.java b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQXATest.java index 4a04dbb617..8c0ce0f18e 100644 --- a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQXATest.java +++ b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/it/IBMMQXATest.java @@ -28,13 +28,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import static org.hamcrest.core.Is.is; @QuarkusTest @QuarkusTestResource(IBMMQTestResource.class) -@EnabledIfSystemProperty(named = "ibm.mq.container.license", matches = "accept") @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestProfile(JmsXAEnabled.class) public class IBMMQXATest { @@ -51,6 +49,7 @@ public class IBMMQXATest { */ @BeforeAll public void startRoutes(TestInfo test) { + destinations.createQueue("exception.queue"); destinations.createQueue("xa"); RestAssured.given() diff --git a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java index c2565aea54..407c9b65fb 100644 --- a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java +++ b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java @@ -20,14 +20,19 @@ import java.util.Map; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; import org.eclipse.microprofile.config.ConfigProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.images.builder.Transferable; import org.testcontainers.utility.DockerImageName; public class IBMMQTestResource implements QuarkusTestResourceLifecycleManager { + private static final Logger LOG = LoggerFactory.getLogger(IBMMQTestResource.class); private static final String IMAGE_NAME = ConfigProvider.getConfig().getValue("ibm-mq.container.image", String.class); private static final int PORT = 1414; + private static final String LICENSE_APPROVAL = "accept"; private static final String QUEUE_MANAGER_NAME = "QM1"; private static final String USER = "app"; private static final String PASSWORD = "passw0rd"; @@ -41,9 +46,10 @@ public class IBMMQTestResource implements QuarkusTestResourceLifecycleManager { @Override public Map<String, String> start() { container = new GenericContainer<>(DockerImageName.parse(IMAGE_NAME)) + .withLogConsumer(new Slf4jLogConsumer(LOG)) .withExposedPorts(PORT) .withEnv(Map.of( - "LICENSE", System.getProperty("ibm.mq.container.license"), + "LICENSE", LICENSE_APPROVAL, "MQ_QMGR_NAME", QUEUE_MANAGER_NAME)) .withCopyToContainer(Transferable.of(PASSWORD), "/run/secrets/mqAdminPassword") .withCopyToContainer(Transferable.of(PASSWORD), "/run/secrets/mqAppPassword") @@ -76,7 +82,7 @@ public class IBMMQTestResource implements QuarkusTestResourceLifecycleManager { } /** - * By default the user does have access just to predefined queues, this will add permissions to access + * By default, the user does have access just to predefined queues, this will add permissions to access * all standard queues + topics and a special system queue. * * @return mqsc config string @@ -84,6 +90,9 @@ public class IBMMQTestResource implements QuarkusTestResourceLifecycleManager { private String mqscConfig() { return "SET AUTHREC PROFILE('*') PRINCIPAL('" + USER + "') OBJTYPE(TOPIC) AUTHADD(ALL)\n" + "SET AUTHREC PROFILE('*') PRINCIPAL('" + USER + "') OBJTYPE(QUEUE) AUTHADD(ALL)\n" - + "SET AUTHREC PROFILE('SYSTEM.DEFAULT.MODEL.QUEUE') OBJTYPE(QUEUE) PRINCIPAL('" + USER + "') AUTHADD(ALL)"; + + "SET AUTHREC PROFILE('SYSTEM.DEFAULT.MODEL.QUEUE') OBJTYPE(QUEUE) PRINCIPAL('" + USER + "') AUTHADD(ALL)\n" + // Need to explicitly set AUTHREC for queues used with JMSReplyTo + + "SET AUTHREC PROFILE('exception.queue') PRINCIPAL('" + USER + "') OBJTYPE(QUEUE) AUTHADD(ALL)\n" + + "REFRESH SECURITY TYPE(AUTHSERV)"; } }
