|
1 | 1 | package org.baeldung.spring.data.cassandra.repository; |
2 | 2 |
|
3 | | -import static junit.framework.TestCase.assertNull; |
4 | | -import static org.hamcrest.CoreMatchers.is; |
5 | | -import static org.junit.Assert.assertEquals; |
6 | | -import static org.junit.Assert.assertThat; |
7 | | - |
8 | | -import java.io.IOException; |
9 | | -import java.util.HashMap; |
10 | | -import java.util.List; |
11 | | - |
| 3 | +import com.datastax.driver.core.Cluster; |
| 4 | +import com.datastax.driver.core.Session; |
| 5 | +import com.datastax.driver.core.querybuilder.QueryBuilder; |
| 6 | +import com.datastax.driver.core.querybuilder.Select; |
| 7 | +import com.datastax.driver.core.utils.UUIDs; |
| 8 | +import com.google.common.collect.ImmutableSet; |
12 | 9 | import org.apache.cassandra.exceptions.ConfigurationException; |
13 | 10 | import org.apache.commons.logging.Log; |
14 | 11 | import org.apache.commons.logging.LogFactory; |
15 | 12 | import org.apache.thrift.transport.TTransportException; |
16 | 13 | import org.baeldung.spring.data.cassandra.config.CassandraConfig; |
17 | 14 | import org.baeldung.spring.data.cassandra.model.Book; |
18 | 15 | import org.cassandraunit.utils.EmbeddedCassandraServerHelper; |
19 | | -import org.junit.After; |
20 | | -import org.junit.AfterClass; |
21 | | -import org.junit.Before; |
22 | | -import org.junit.BeforeClass; |
23 | | -import org.junit.Test; |
| 16 | +import org.junit.*; |
24 | 17 | import org.junit.runner.RunWith; |
25 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
26 | 19 | import org.springframework.cassandra.core.cql.CqlIdentifier; |
|
29 | 22 | import org.springframework.test.context.ContextConfiguration; |
30 | 23 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
31 | 24 |
|
32 | | -import com.datastax.driver.core.Cluster; |
33 | | -import com.datastax.driver.core.Session; |
34 | | -import com.datastax.driver.core.querybuilder.QueryBuilder; |
35 | | -import com.datastax.driver.core.querybuilder.Select; |
36 | | -import com.datastax.driver.core.utils.UUIDs; |
37 | | -import com.google.common.collect.ImmutableSet; |
| 25 | +import java.io.IOException; |
| 26 | +import java.util.HashMap; |
| 27 | +import java.util.List; |
| 28 | + |
| 29 | +import static junit.framework.TestCase.assertNull; |
| 30 | +import static org.hamcrest.CoreMatchers.is; |
| 31 | +import static org.junit.Assert.assertEquals; |
| 32 | +import static org.junit.Assert.assertThat; |
38 | 33 |
|
39 | 34 | @RunWith(SpringJUnit4ClassRunner.class) |
40 | 35 | @ContextConfiguration(classes = CassandraConfig.class) |
@@ -62,7 +57,7 @@ public static void startCassandraEmbedded() throws InterruptedException, TTransp |
62 | 57 | Session session = cluster.connect(); |
63 | 58 | session.execute(KEYSPACE_CREATION_QUERY); |
64 | 59 | session.execute(KEYSPACE_ACTIVATE_QUERY); |
65 | | - Thread.sleep(5000); |
| 60 | + Thread.sleep(2000); |
66 | 61 | LOGGER.info("KeySpace created and activated."); |
67 | 62 | } |
68 | 63 |
|
|
0 commit comments