// Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
//     ActionResponse handle(AMQPMessageBundle messageBundle);
//     void notifyOfActionFailure(Exception e);
//     void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
// 
// Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPMessageBundle.java
// public class AMQPMessageBundle implements TransportMessageBundle {
//     private String consumerTag;
//     private Envelope envelope;
//     private AMQP.BasicProperties basicProperties;
//     private byte[] body;
// 
//     private static AMQP.BasicProperties initialProperties() {
//         return initialProperties(null);
//     }
// 
//     private static AMQP.BasicProperties initialProperties(Map<String, Object> additionalHeaders) {
//         Map<String, Object> headers = new HashMap<String, Object>();
// 
//         if (additionalHeaders != null) {
//             headers.putAll(additionalHeaders);
//         }
// 
//         headers.put("conduit-retry-count", 0);
// 
//         return new AMQP.BasicProperties()
//                 .builder()
//                 .deliveryMode(2 /*persistent*/)
//                 .priority(0)
//                 .headers(headers)
//                 .contentType("text/plain")
//                 .build();
//     }
// 
//     public AMQPMessageBundle(String consumerTag, Envelope envelope, AMQP.BasicProperties basicProperties, byte[] body) {
//         this.consumerTag = consumerTag;
//         this.envelope = envelope;
//         this.basicProperties = basicProperties;
//         this.body = body;
//     }
// 
//     public AMQPMessageBundle(String message) {
//         this(null, null, initialProperties(), message.getBytes());
//     }
// 
//     public AMQPMessageBundle(String message, Map<String, Object> headers) {
//         this(null, null, initialProperties(headers), message.getBytes());
//     }
// 
//     public String getConsumerTag() {
//         return consumerTag;
//     }
// 
//     public Envelope getEnvelope() {
//         return envelope;
//     }
// 
//     public AMQP.BasicProperties getBasicProperties() {
//         return basicProperties;
//     }
// 
//     public byte[] getBody() {
//         return body;
//     }
// }


import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.impl.AMQImpl;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import java.io.IOException;
import java.time.Duration;
import java.util.concurrent.TimeoutException;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyLong;
import static org.mockito.Mockito.anyMap;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package io.rtr.conduit.amqp.impl;




public class AMQPTransportTest {
    Channel channel;
    AMQPTransport amqpTransport;
    AMQPPublishProperties properties;
    AMQPMessageBundle messageBundle;
// Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
//     ActionResponse handle(AMQPMessageBundle messageBundle);
//     void notifyOfActionFailure(Exception e);
//     void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
// 
// Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPMessageBundle.java
// public class AMQPMessageBundle implements TransportMessageBundle {
//     private String consumerTag;
//     private Envelope envelope;
//     private AMQP.BasicProperties basicProperties;
//     private byte[] body;
// 
//     private static AMQP.BasicProperties initialProperties() {
//         return initialProperties(null);
//     }
// 
//     private static AMQP.BasicProperties initialProperties(Map<String, Object> additionalHeaders) {
//         Map<String, Object> headers = new HashMap<String, Object>();
// 
//         if (additionalHeaders != null) {
//             headers.putAll(additionalHeaders);
//         }
// 
//         headers.put("conduit-retry-count", 0);
// 
//         return new AMQP.BasicProperties()
//                 .builder()
//                 .deliveryMode(2 /*persistent*/)
//                 .priority(0)
//                 .headers(headers)
//                 .contentType("text/plain")
//                 .build();
//     }
// 
//     public AMQPMessageBundle(String consumerTag, Envelope envelope, AMQP.BasicProperties basicProperties, byte[] body) {
//         this.consumerTag = consumerTag;
//         this.envelope = envelope;
//         this.basicProperties = basicProperties;
//         this.body = body;
//     }
// 
//     public AMQPMessageBundle(String message) {
//         this(null, null, initialProperties(), message.getBytes());
//     }
// 
//     public AMQPMessageBundle(String message, Map<String, Object> headers) {
//         this(null, null, initialProperties(headers), message.getBytes());
//     }
// 
//     public String getConsumerTag() {
//         return consumerTag;
//     }
// 
//     public Envelope getEnvelope() {
//         return envelope;
//     }
// 
//     public AMQP.BasicProperties getBasicProperties() {
//         return basicProperties;
//     }
// 
//     public byte[] getBody() {
//         return body;
//     }
// }


// Path: conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPTransportTest.java
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.impl.AMQImpl;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import java.io.IOException;
import java.time.Duration;
import java.util.concurrent.TimeoutException;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyLong;
import static org.mockito.Mockito.anyMap;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package io.rtr.conduit.amqp.impl;




public class AMQPTransportTest {
    Channel channel;
    AMQPTransport amqpTransport;
    AMQPPublishProperties properties;
    AMQPMessageBundle messageBundle;
    AMQPConsumerCallback consumerCallback = mock(AMQPConsumerCallback.class);