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

This commit is contained in:
Martijn van Groningen 2013-12-02 14:50:00 +01:00
parent e18bee50ef
commit 5488bab003
1 changed files with 2 additions and 1 deletions

View File

@ -558,7 +558,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
.setIndices("test").setDocumentType("type") .setIndices("test").setDocumentType("type")
.setSource(jsonBuilder().startObject().startObject("doc").field("field", "val").endObject().endObject()) .setSource(jsonBuilder().startObject().startObject("doc").field("field", "val").endObject().endObject())
.execute().actionGet(); .execute().actionGet();
assertThat(response.getMatches(), arrayWithSize(1)); assertMatchCount(response, 1l);
assertThat(convertFromTextArray(response.getMatches(), "test"), arrayContaining("1")); assertThat(convertFromTextArray(response.getMatches(), "test"), arrayContaining("1"));
IndicesStatsResponse indicesResponse = client().admin().indices().prepareStats("test").execute().actionGet(); IndicesStatsResponse indicesResponse = client().admin().indices().prepareStats("test").execute().actionGet();
@ -579,6 +579,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
.setIndices("test").setDocumentType("type") .setIndices("test").setDocumentType("type")
.setSource(jsonBuilder().startObject().startObject("doc").field("field", "val").endObject().endObject()) .setSource(jsonBuilder().startObject().startObject("doc").field("field", "val").endObject().endObject())
.execute().actionGet(); .execute().actionGet();
assertMatchCount(response, 1l);
assertThat(response.getMatches(), arrayWithSize(1)); assertThat(response.getMatches(), arrayWithSize(1));
assertThat(convertFromTextArray(response.getMatches(), "test"), arrayContaining("1")); assertThat(convertFromTextArray(response.getMatches(), "test"), arrayContaining("1"));