Şu satırı dahil ederiz
<dependency><groupId>org.testcontainers</groupId> <artifactId>testcontainers</artifactId> <version>${testcontainers.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.testcontainers</groupId> <artifactId>rabbitmq</artifactId> <version>${testcontainers.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.rabbitmq.jms</groupId> <artifactId>rabbitmq-jms</artifactId> <version>3.1.0</version> </dependency>
Şöyle yaparız
import com.rabbitmq.jms.admin.RMQConnectionFactory;import org.testcontainers.containers.RabbitMQContainer;import jakarta.jms.ConnectionFactory;RabbitMQContainer rabbitMQContainer = new RabbitMQContainer("rabbitmq:3.8");rabbitMQContainer.start();RMQConnectionFactory f = new RMQConnectionFactory();f.setUri(rabbitMQContainer.getAmqpUrl());...rabbitMQContainer.stop();
Hiç yorum yok:
Yorum Gönder