You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2023/01/25 08:51:46 UTC

[GitHub] [camel] Croway commented on a diff in pull request #9199: CAMEL-18957: add support for running the Camel Context as a JUnit 5 extension

Croway commented on code in PR #9199:
URL: https://github.com/apache/camel/pull/9199#discussion_r1086354590


##########
components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java:
##########
@@ -26,29 +26,49 @@
 import jakarta.jms.TextMessage;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.EndpointInject;
+import org.apache.camel.ProducerTemplate;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.infra.artemis.services.ArtemisService;
+import org.apache.camel.test.infra.artemis.services.ArtemisServiceFactory;
+import org.apache.camel.test.infra.core.CamelContextExtension;
+import org.apache.camel.test.infra.core.ContextFixture;
+import org.apache.camel.test.infra.core.DefaultCamelContextExtension;
+import org.apache.camel.test.infra.core.RouteFixture;
 import org.apache.qpid.jms.message.JmsMessage;
 import org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent;
 import static org.apache.camel.component.amqp.AMQPConnectionDetails.discoverAMQP;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
-public class AMQPRouteTest extends AMQPTestSupport {
+public class AMQPRouteTest {
 
-    @EndpointInject("mock:result")
-    MockEndpoint resultEndpoint;
+    @RegisterExtension
+    protected static ArtemisService service = ArtemisServiceFactory.createSingletonAMQPService();
 
-    String expectedBody = "Hello there!";
+    @RegisterExtension
+    protected static CamelContextExtension contextExtension = new DefaultCamelContextExtension();

Review Comment:
   Can this extension be added to AMQPTestSupport class? just to avoid duplicates



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org