Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Royer committed Feb 12, 2018
1 parent 027cbfd commit 246ebef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/test/java/org/elassandra/CompositeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,11 @@ public void testTimeserieEmptyTest() throws Exception {

@Test
public void testReadBeforeWrite() throws Exception {
createIndex("test", Settings.builder().build());
ensureGreen("test");

process(ConsistencyLevel.ONE,"CREATE KEYSPACE IF NOT EXISTS test WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'DC1':'1' }");
process(ConsistencyLevel.ONE,"CREATE TABLE IF NOT EXISTS test.t1 ( partition text, clustering int , status int, data text, primary key ((partition),clustering) )");

XContentBuilder mapping = XContentFactory.jsonBuilder().startObject().startObject("t1").field("discover",".*").endObject().endObject();
assertAcked(client().admin().indices().preparePutMapping("test").setType("t1").setSource(mapping).get());
assertAcked(client().admin().indices().prepareCreate("test").addMapping("t1", mapping).get());

process(ConsistencyLevel.ONE,"INSERT INTO test.t1 (partition, clustering, status, data) VALUES ('one', 1, 4, 'foo');");
process(ConsistencyLevel.ONE,"INSERT INTO test.t1 (partition, clustering, status, data) VALUES ('one', 2, 5, 'foo5');");
Expand All @@ -425,5 +423,8 @@ public void testReadBeforeWrite() throws Exception {
rsp = client().prepareSearch().setIndices("test").setTypes("t1").setQuery(QueryBuilders.matchAllQuery()).get();
assertThat( rsp.getHits().getTotalHits(), equalTo(2L));
}




}

0 comments on commit 246ebef

Please sign in to comment.