#224 - Use external or embedded (if external Apache Cassandra is not available) for Cassandra examples.
We now check whether an external Apache Cassandra instance is available at localhost:9042 and use it to run the examples. Otherwise, if no external Apache Cassandra instance is available, we start an embedded Cassandra instance.
This commit is contained in:
committed by
Oliver Gierke
parent
1d3af17572
commit
d9f77903ef
@@ -15,10 +15,11 @@
|
||||
*/
|
||||
package example.springdata.cassandra.java8;
|
||||
|
||||
import example.springdata.cassandra.util.RequiresCassandraKeyspace;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import example.springdata.cassandra.util.CassandraKeyspace;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -41,8 +42,8 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
@SpringBootTest(classes = CassandraConfiguration.class)
|
||||
public class Java8IntegrationTests {
|
||||
|
||||
@ClassRule
|
||||
public final static RequiresCassandraKeyspace CASSANDRA_KEYSPACE = RequiresCassandraKeyspace.onLocalhost().atLeast(Version.parse("3.0"));
|
||||
@ClassRule public final static CassandraKeyspace CASSANDRA_KEYSPACE = CassandraKeyspace.onLocalhost()
|
||||
.atLeast(Version.parse("3.0"));
|
||||
|
||||
@Autowired PersonRepository repository;
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ package example.springdata.cassandra.java8;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import example.springdata.cassandra.util.CassandraKeyspace;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
|
||||
@@ -30,8 +32,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.util.Version;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import example.springdata.cassandra.util.RequiresCassandraKeyspace;
|
||||
|
||||
/**
|
||||
* Integration test to show the usage of JSR-310 date/time types with Spring Data Cassandra.
|
||||
*
|
||||
@@ -41,7 +41,7 @@ import example.springdata.cassandra.util.RequiresCassandraKeyspace;
|
||||
@SpringBootTest(classes = CassandraConfiguration.class)
|
||||
public class Jsr310IntegrationTests {
|
||||
|
||||
@ClassRule public final static RequiresCassandraKeyspace CASSANDRA_KEYSPACE = RequiresCassandraKeyspace.onLocalhost()
|
||||
@ClassRule public final static CassandraKeyspace CASSANDRA_KEYSPACE = CassandraKeyspace.onLocalhost()
|
||||
.atLeast(Version.parse("3.0"));
|
||||
|
||||
@Autowired OrderRepository repository;
|
||||
|
||||
Reference in New Issue
Block a user