浏览代码

Use EA#assertMatchCount() over just checking the match count.

Martijn van Groningen 12 年之前
父节点
当前提交
cf63ea212f
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/test/java/org/elasticsearch/percolator/PercolatorTests.java

+ 4 - 0
src/test/java/org/elasticsearch/percolator/PercolatorTests.java

@@ -848,6 +848,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
                 .setIndices("test1").setDocumentType("type")
                 .setSource(jsonBuilder().startObject().startObject("doc").field("field1", "value").endObject().endObject())
                 .execute().actionGet();
+        assertMatchCount(response, 5l);
         assertThat(response.getMatches(), arrayWithSize(5));
 
         logger.info("--> Percolate doc to index test2");
@@ -855,6 +856,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
                 .setIndices("test2").setDocumentType("type")
                 .setSource(jsonBuilder().startObject().startObject("doc").field("field1", "value").endObject().endObject())
                 .execute().actionGet();
+        assertMatchCount(response, 5l);
         assertThat(response.getMatches(), arrayWithSize(5));
 
         logger.info("--> Percolate doc to index test1 and test2");
@@ -862,6 +864,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
                 .setIndices("test1", "test2").setDocumentType("type")
                 .setSource(jsonBuilder().startObject().startObject("doc").field("field1", "value").endObject().endObject())
                 .execute().actionGet();
+        assertMatchCount(response, 10l);
         assertThat(response.getMatches(), arrayWithSize(10));
 
         logger.info("--> Percolate doc to index test2 and test3, with ignore missing");
@@ -870,6 +873,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
                 .setIgnoreIndices(IgnoreIndices.MISSING)
                 .setSource(jsonBuilder().startObject().startObject("doc").field("field1", "value").endObject().endObject())
                 .execute().actionGet();
+        assertMatchCount(response, 5l);
         assertThat(response.getMatches(), arrayWithSize(5));
 
         logger.info("--> Adding aliases");