summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/indexing
diff options
context:
space:
mode:
authorSimon Willnauer <simonw@apache.org>2017-02-08 14:40:08 +0100
committerGitHub <noreply@github.com>2017-02-08 14:40:08 +0100
commitecb01c15b9a6645f22f153eb099a377e70e398c8 (patch)
tree6281a85417a51ac6265e44d93ff92322fee4b199 /core/src/test/java/org/elasticsearch/indexing
parent2d6d871f5c70b11c23a5b99b5e3a0bf0cff8c6b0 (diff)
Fold InternalSearchHits and friends into their interfaces (#23042)
We have a bunch of interfaces that have only a single implementation for 6 years now. These interfaces are pretty useless from a SW development perspective and only add unnecessary abstractions. They also require lots of casting in many places where we expect that there is only one concrete implementation. This change removes the interfaces, makes all of the classes final and removes the duplicate `foo` `getFoo` accessors in favor of `getFoo` from these classes.
Diffstat (limited to 'core/src/test/java/org/elasticsearch/indexing')
-rw-r--r--core/src/test/java/org/elasticsearch/indexing/IndexActionIT.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/core/src/test/java/org/elasticsearch/indexing/IndexActionIT.java b/core/src/test/java/org/elasticsearch/indexing/IndexActionIT.java
index 43326116f1..9b5cb7a138 100644
--- a/core/src/test/java/org/elasticsearch/indexing/IndexActionIT.java
+++ b/core/src/test/java/org/elasticsearch/indexing/IndexActionIT.java
@@ -18,28 +18,20 @@
*/
package org.elasticsearch.indexing;
-import org.elasticsearch.Version;
import org.elasticsearch.action.DocWriteResponse;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.MetaDataCreateIndexService;
-import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.VersionType;
import org.elasticsearch.index.mapper.MapperParsingException;
import org.elasticsearch.indices.InvalidIndexNameException;
-import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
-import org.elasticsearch.test.InternalSettingsPlugin;
-import org.elasticsearch.test.VersionUtils;
import org.elasticsearch.test.hamcrest.ElasticsearchAssertions;
import org.elasticsearch.test.junit.annotations.TestLogging;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Random;
@@ -78,8 +70,8 @@ public class IndexActionIT extends ESIntegTestCase {
try {
logger.debug("running search with all types");
SearchResponse response = client().prepareSearch("test").get();
- if (response.getHits().totalHits() != numOfDocs) {
- final String message = "Count is " + response.getHits().totalHits() + " but " + numOfDocs + " was expected. "
+ if (response.getHits().getTotalHits() != numOfDocs) {
+ final String message = "Count is " + response.getHits().getTotalHits() + " but " + numOfDocs + " was expected. "
+ ElasticsearchAssertions.formatShardStatus(response);
logger.error("{}. search response: \n{}", message, response);
fail(message);
@@ -93,8 +85,8 @@ public class IndexActionIT extends ESIntegTestCase {
try {
logger.debug("running search with a specific type");
SearchResponse response = client().prepareSearch("test").setTypes("type").get();
- if (response.getHits().totalHits() != numOfDocs) {
- final String message = "Count is " + response.getHits().totalHits() + " but " + numOfDocs + " was expected. "
+ if (response.getHits().getTotalHits() != numOfDocs) {
+ final String message = "Count is " + response.getHits().getTotalHits() + " but " + numOfDocs + " was expected. "
+ ElasticsearchAssertions.formatShardStatus(response);
logger.error("{}. search response: \n{}", message, response);
fail(message);