// 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/main/java/io/rtr/conduit/amqp/ActionResponse.java
// public class ActionResponse {
// 
//     private Action action;
//     private String reason;
//     public static final String REASON_KEY = "reason";
// 
//     private ActionResponse(Action action, String reason) {
//         this.action = action;
//         this.reason = reason;
//     }
// 
//     public static ActionResponse acknowledge() {
//         return new ActionResponse(Action.Acknowledge, null);
//     }
// 
//     public static ActionResponse retry() {
//         return new ActionResponse(Action.RejectAndRequeue, null);
//     }
// 
//     public static ActionResponse retry(String reason, Object... args) {
//         return new ActionResponse(Action.RejectAndRequeue, String.format(reason, args));
//     }
// 
//     public static ActionResponse discard() {
//         return new ActionResponse(Action.RejectAndDiscard, null);
//     }
// 
//     public static ActionResponse discard(String reason, Object... args) {
//         return new ActionResponse(Action.RejectAndDiscard, String.format(reason, args));
//     }
// 
//     public String getReason() {
//         return reason;
//     }
// 
//     public Action getAction() {
//         return action;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         ActionResponse that = (ActionResponse) o;
// 
//         if (action != that.action) return false;
//         if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = action != null ? action.hashCode() : 0;
//         result = 31 * result + (reason != null ? reason.hashCode() : 0);
//         return result;
//     }
// 
//     @Override
//     public String toString() {
//         return "ActionResponse{" +
//                 "action=" + action +
//                 ", reason='" + reason + '\'' +
//                 '}';
//     }
// 
//     public enum Action {
//         Acknowledge,            //! The transport will ack the message explicitly.
//         RejectAndRequeue,       //! The message wasn't meant to be processed.
//                                 //  For example, if the message delivered is of
//                                 //  a higher version than what we are able to
//                                 //  deal with.
//         RejectAndDiscard        //! A malformed message, place it on a poison queue.
//     }
// 
// 
// 
// }


import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import java.util.ArrayList;
import java.util.List;
package io.rtr.conduit.util;



public class RecordingAmqpCallbackHandler extends LoggingAmqpCallbackHandler {
    private final List<AMQPMessageBundle> capturedMessages = new ArrayList<>();

    @Override
    public ActionResponse handle(AMQPMessageBundle messageBundle) {
        capturedMessages.add(messageBundle);
        return ActionResponse.acknowledge();
    }

    public List<AMQPMessageBundle> getCapturedMessages() {
// 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/main/java/io/rtr/conduit/amqp/ActionResponse.java
// public class ActionResponse {
// 
//     private Action action;
//     private String reason;
//     public static final String REASON_KEY = "reason";
// 
//     private ActionResponse(Action action, String reason) {
//         this.action = action;
//         this.reason = reason;
//     }
// 
//     public static ActionResponse acknowledge() {
//         return new ActionResponse(Action.Acknowledge, null);
//     }
// 
//     public static ActionResponse retry() {
//         return new ActionResponse(Action.RejectAndRequeue, null);
//     }
// 
//     public static ActionResponse retry(String reason, Object... args) {
//         return new ActionResponse(Action.RejectAndRequeue, String.format(reason, args));
//     }
// 
//     public static ActionResponse discard() {
//         return new ActionResponse(Action.RejectAndDiscard, null);
//     }
// 
//     public static ActionResponse discard(String reason, Object... args) {
//         return new ActionResponse(Action.RejectAndDiscard, String.format(reason, args));
//     }
// 
//     public String getReason() {
//         return reason;
//     }
// 
//     public Action getAction() {
//         return action;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         ActionResponse that = (ActionResponse) o;
// 
//         if (action != that.action) return false;
//         if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = action != null ? action.hashCode() : 0;
//         result = 31 * result + (reason != null ? reason.hashCode() : 0);
//         return result;
//     }
// 
//     @Override
//     public String toString() {
//         return "ActionResponse{" +
//                 "action=" + action +
//                 ", reason='" + reason + '\'' +
//                 '}';
//     }
// 
//     public enum Action {
//         Acknowledge,            //! The transport will ack the message explicitly.
//         RejectAndRequeue,       //! The message wasn't meant to be processed.
//                                 //  For example, if the message delivered is of
//                                 //  a higher version than what we are able to
//                                 //  deal with.
//         RejectAndDiscard        //! A malformed message, place it on a poison queue.
//     }
// 
// 
// 
// }


// Path: conduit/src/test/java/io/rtr/conduit/util/RecordingAmqpCallbackHandler.java
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import java.util.ArrayList;
import java.util.List;

package io.rtr.conduit.util;



public class RecordingAmqpCallbackHandler extends LoggingAmqpCallbackHandler {
    private final List<AMQPMessageBundle> capturedMessages = new ArrayList<>();

    @Override
    public ActionResponse handle(AMQPMessageBundle messageBundle) {
        capturedMessages.add(messageBundle);
        return ActionResponse.acknowledge();
    }

    public List<AMQPMessageBundle> getCapturedMessages() {
        return capturedMessages;