Try to make SampleCassandraApplicationTests' port config more robust

This commit is contained in:
Andy Wilkinson
2016-04-07 14:34:37 +01:00
parent 55ad905d98
commit 66830ea1e5
2 changed files with 6 additions and 4 deletions

View File

@@ -53,7 +53,8 @@
<phase>process-resources</phase>
<configuration>
<portNames>
<portName>cassandra.port</portName>
<portName>cassandra.port.native-transport</portName>
<portName>cassandra.port.storage</portName>
</portNames>
</configuration>
</execution>
@@ -64,8 +65,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<spring.data.cassandra.port>${cassandra.port}</spring.data.cassandra.port>
<cassandra.native_transport_port>${cassandra.port}</cassandra.native_transport_port>
<spring.data.cassandra.port>${cassandra.port.native-transport}</spring.data.cassandra.port>
<cassandra.native_transport_port>${cassandra.port.native-transport}</cassandra.native_transport_port>
<cassandra.storage_port>${cassandra.port.storage}</cassandra.storage_port>
</systemPropertyVariables>
</configuration>
</plugin>

View File

@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@TestExecutionListeners(mergeMode = MergeMode.MERGE_WITH_DEFAULTS, listeners = {
OrderedCassandraTestExecutionListener.class })
@SpringBootTest("spring.data.cassandra.port=9142")
@SpringBootTest
@CassandraDataSet(keyspace = "mykeyspace", value = "setup.cql")
@EmbeddedCassandra(timeout = 60000)
public class SampleCassandraApplicationTests {