// Path: src/test/java/uk/sky/cqlmigrate/util/PortScavenger.java
// public class PortScavenger {
// 
//     public static int getFreePort() {
//         ServerSocket socket = null;
//         try {
//             socket = new ServerSocket(0);
//             socket.setReuseAddress(true);
//             int port = socket.getLocalPort();
//             closeSocket(socket);
//             return port;
//         } catch (IOException ignored) {
//         } finally {
//             closeSocket(socket);
//         }
//         throw new IllegalStateException("Could not find a free TCP/IP port to start embedded Jetty HTTP Server on");
// 
//     }
// 
//     private static void closeSocket(ServerSocket socket) {
//         if (socket != null) {
//             try {
//                 socket.close();
//             } catch (IOException ignored) {
//             }
//         }
//     }
// }


import com.datastax.oss.driver.api.core.ConsistencyLevel;
import com.datastax.oss.simulacron.common.cluster.ClusterSpec;
import com.datastax.oss.simulacron.common.cluster.DataCenterSpec;
import com.datastax.oss.simulacron.common.cluster.QueryLog;
import com.datastax.oss.simulacron.common.cluster.RequestPrime;
import com.datastax.oss.simulacron.common.request.Query;
import com.datastax.oss.simulacron.common.result.SuccessResult;
import com.datastax.oss.simulacron.common.stubbing.Prime;
import com.datastax.oss.simulacron.common.stubbing.PrimeDsl;
import com.datastax.oss.simulacron.server.BoundCluster;
import com.datastax.oss.simulacron.server.Server;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.junit.*;
import uk.sky.cqlmigrate.util.PortScavenger;
import java.net.Inet4Address;
import java.net.InetSocketAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import static com.datastax.oss.simulacron.common.stubbing.PrimeDsl.*;
import static java.lang.String.valueOf;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
package uk.sky.cqlmigrate;




public class CqlMigratorConsistencyLevelIntegrationTest {

    private static final String CLIENT_ID = UUID.randomUUID().toString();
// Path: src/test/java/uk/sky/cqlmigrate/util/PortScavenger.java
// public class PortScavenger {
// 
//     public static int getFreePort() {
//         ServerSocket socket = null;
//         try {
//             socket = new ServerSocket(0);
//             socket.setReuseAddress(true);
//             int port = socket.getLocalPort();
//             closeSocket(socket);
//             return port;
//         } catch (IOException ignored) {
//         } finally {
//             closeSocket(socket);
//         }
//         throw new IllegalStateException("Could not find a free TCP/IP port to start embedded Jetty HTTP Server on");
// 
//     }
// 
//     private static void closeSocket(ServerSocket socket) {
//         if (socket != null) {
//             try {
//                 socket.close();
//             } catch (IOException ignored) {
//             }
//         }
//     }
// }


// Path: src/test/java/uk/sky/cqlmigrate/CqlMigratorConsistencyLevelIntegrationTest.java
import com.datastax.oss.driver.api.core.ConsistencyLevel;
import com.datastax.oss.simulacron.common.cluster.ClusterSpec;
import com.datastax.oss.simulacron.common.cluster.DataCenterSpec;
import com.datastax.oss.simulacron.common.cluster.QueryLog;
import com.datastax.oss.simulacron.common.cluster.RequestPrime;
import com.datastax.oss.simulacron.common.request.Query;
import com.datastax.oss.simulacron.common.result.SuccessResult;
import com.datastax.oss.simulacron.common.stubbing.Prime;
import com.datastax.oss.simulacron.common.stubbing.PrimeDsl;
import com.datastax.oss.simulacron.server.BoundCluster;
import com.datastax.oss.simulacron.server.Server;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.junit.*;
import uk.sky.cqlmigrate.util.PortScavenger;
import java.net.Inet4Address;
import java.net.InetSocketAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import static com.datastax.oss.simulacron.common.stubbing.PrimeDsl.*;
import static java.lang.String.valueOf;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;

package uk.sky.cqlmigrate;




public class CqlMigratorConsistencyLevelIntegrationTest {

    private static final String CLIENT_ID = UUID.randomUUID().toString();
    private static final int defaultStartingPort = PortScavenger.getFreePort();