I am having issue with Spring unit testing with Embedded Cassandra. The issue is both Embedded Cassandra and My Cassandra Server are starting at the same time. How to make sure that during unit testing only Embedded Cassandra Starts.
I am using spring-data for Cassandra.
I have the following Spring Config File.
cassandra.contactpoints=xxx.yyy.1.42
cassandra.keyspace=dialoguedev
My context file
<?xml version='1.0'?>
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU" xmlns:cassandra="http://ift.tt/1zqEEMS"
xmlns:context="http://ift.tt/GArMu7"
xsi:schemaLocation="http://ift.tt/1M2NB3x http://ift.tt/1ATVmqF
http://ift.tt/1zqEEMS http://ift.tt/1M2Nzso
http://ift.tt/GArMu6 http://ift.tt/1jdM0fG
http://ift.tt/GArMu7 http://ift.tt/1bGeTcI">
<context:component-scan base-package="com.xxx.cassandra" />
<context:property-placeholder location="classpath:cassandra.properties" />
<cassandra:cluster contact-points="${cassandra.contactpoints}"
/>
<cassandra:session keyspace-name="${cassandra.keyspace}"
schema-action="RECREATE"
/>
<cassandra:mapping />
<cassandra:converter />
<cassandra:template />
<cassandra:repositories base-package="com.xxx.cassandra.repository" />
My test case is as follows:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value = {"classpath:cassandrabeans.xml"})
@TestExecutionListeners( { DependencyInjectionTestExecutionListener.class, CassandraUnitDependencyInjectionTestExecutionListener.class })
@EmbeddedCassandra
public class EventLogInsertTest extends AbstractCassandraIntegrationTest {
@Autowired
private EventLogEventRepository eventLogEventRepository;
@Autowired
private EventLogPersonRepository eventLogPersonRepository;
@Test
public void runAllTableInsertTest() throws Exception{
}
}
Aucun commentaire:
Enregistrer un commentaire