cleanup testcase

This commit is contained in:
Simon Willnauer 2013-09-28 20:36:15 +02:00
parent 2f0271062a
commit 831c3fabc6
1 changed files with 2 additions and 7 deletions

View File

@ -22,9 +22,7 @@ package org.elasticsearch.indices.mapping;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.WriteConsistencyLevel; import org.elasticsearch.action.WriteConsistencyLevel;
import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.test.AbstractIntegrationTest; import org.elasticsearch.test.AbstractIntegrationTest;
import org.junit.Test; import org.junit.Test;
@ -79,11 +77,8 @@ public class ConcurrentDynamicTemplateTests extends AbstractIntegrationTest {
latch.await(); latch.await();
assertThat(throwable, emptyIterable()); assertThat(throwable, emptyIterable());
refresh(); refresh();
MatchQueryBuilder builder = QueryBuilders.matchQuery(fieldName, "test-user"); assertEquals(numDocs, client().prepareSearch("test").setQuery(QueryBuilders.matchQuery(fieldName, "test-user")).execute().actionGet().getHits().getTotalHits());
SearchHits sh = client().prepareSearch("test").setQuery(builder).execute().actionGet().getHits(); assertEquals(0, client().prepareSearch("test").setQuery(QueryBuilders.matchQuery(fieldName, "test user")).execute().actionGet().getHits().getTotalHits());
assertEquals(sh.getTotalHits(), numDocs);
assertEquals(client().prepareSearch("test").setQuery(QueryBuilders.matchQuery(fieldName, "test user")).execute().actionGet().getHits().getTotalHits(), 0);
} }
} }