Work around for JDK-8039214 on JDK 9

This commit is contained in:
Jason Tedor 2015-08-27 23:29:22 -04:00
parent 3e88cc0bd0
commit 90bc784194
1 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,7 @@ package org.elasticsearch.search.suggest;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
@ -29,7 +30,6 @@ import org.junit.Test;
import java.util.List;
import java.util.Locale;
import static org.elasticsearch.common.util.CollectionUtils.iterableAsArrayList;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.test.ESIntegTestCase.Scope;
import static org.hamcrest.Matchers.hasSize;
@ -76,7 +76,9 @@ public class CustomSuggesterSearchIT extends ESIntegTestCase {
SearchResponse searchResponse = searchRequestBuilder.execute().actionGet();
// TODO: infer type once JI-9019884 is fixed
List<Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>> suggestions = iterableAsArrayList(searchResponse.getSuggest().getSuggestion("someName"));
// TODO: see also JDK-8039214
List<Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>> suggestions
= CollectionUtils.<Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>iterableAsArrayList(searchResponse.getSuggest().getSuggestion("someName"));
assertThat(suggestions, hasSize(2));
assertThat(suggestions.get(0).getText().string(), is(String.format(Locale.ROOT, "%s-%s-%s-12", randomText, randomField, randomSuffix)));
assertThat(suggestions.get(1).getText().string(), is(String.format(Locale.ROOT, "%s-%s-%s-123", randomText, randomField, randomSuffix)));