// Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportExecutor.java
// public class TransportExecutor extends ThreadPoolExecutor {
// 
//     // From ConsumerWorkService
//     private static final int DEFAULT_NUM_THREADS = Runtime.getRuntime().availableProcessors() * 2;
// 
//     private static ThreadFactory buildCountedDaemonThreadFactory() {
//         AtomicInteger threadCount = new AtomicInteger(0);
//         return run -> {
//             Thread thread = new Thread(run);
//             thread.setDaemon(true);
//             thread.setName(String.format("AMQPConnection-%s", threadCount.getAndIncrement()));
//             return thread;
//         };
//     }
// 
//     public TransportExecutor() {
//         this(DEFAULT_NUM_THREADS, buildCountedDaemonThreadFactory());
//     }
// 
//     /**
//      * Based on Executors.newFixedThreadPool
//      * @param nThreads
//      * @param threadFactory
//      */
//     public TransportExecutor(int nThreads, ThreadFactory threadFactory) {
//         super(nThreads, nThreads,
//                 0L, TimeUnit.MILLISECONDS,
//                 new LinkedBlockingQueue<Runnable>(),
//                 threadFactory);
//     }
// }


import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.transport.TransportExecutor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
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.anyInt;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
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 AMQPConnectionTest {
    private final static int CONNECTION_TIMEOUT = 1337;
    private final static int PORT = 42;

    Connection mockConnection;
    ConnectionFactory mockFactory;
// Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportExecutor.java
// public class TransportExecutor extends ThreadPoolExecutor {
// 
//     // From ConsumerWorkService
//     private static final int DEFAULT_NUM_THREADS = Runtime.getRuntime().availableProcessors() * 2;
// 
//     private static ThreadFactory buildCountedDaemonThreadFactory() {
//         AtomicInteger threadCount = new AtomicInteger(0);
//         return run -> {
//             Thread thread = new Thread(run);
//             thread.setDaemon(true);
//             thread.setName(String.format("AMQPConnection-%s", threadCount.getAndIncrement()));
//             return thread;
//         };
//     }
// 
//     public TransportExecutor() {
//         this(DEFAULT_NUM_THREADS, buildCountedDaemonThreadFactory());
//     }
// 
//     /**
//      * Based on Executors.newFixedThreadPool
//      * @param nThreads
//      * @param threadFactory
//      */
//     public TransportExecutor(int nThreads, ThreadFactory threadFactory) {
//         super(nThreads, nThreads,
//                 0L, TimeUnit.MILLISECONDS,
//                 new LinkedBlockingQueue<Runnable>(),
//                 threadFactory);
//     }
// }


// Path: conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPConnectionTest.java
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.MetricsCollector;
import io.rtr.conduit.amqp.transport.TransportExecutor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
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.anyInt;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
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 AMQPConnectionTest {
    private final static int CONNECTION_TIMEOUT = 1337;
    private final static int PORT = 42;

    Connection mockConnection;
    ConnectionFactory mockFactory;
    TransportExecutor mockExecutor;