[Tests] Fixing test failure in CompletionSuggesterBuilderTests
This commit is contained in:
parent
00a9811f02
commit
31f73cc06c
|
@ -152,6 +152,8 @@ public abstract class AbstractSuggestionBuilderTestCase<SB extends SuggestionBui
|
|||
}
|
||||
|
||||
public void testBuild() throws IOException {
|
||||
for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) {
|
||||
SB suggestionBuilder = randomTestBuilder();
|
||||
Settings indexSettings = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
|
||||
IndexSettings idxSettings = IndexSettingsModule.newIndexSettings(new Index(randomAlphaOfLengthBetween(1, 10), "_na_"),
|
||||
indexSettings);
|
||||
|
@ -177,8 +179,6 @@ public abstract class AbstractSuggestionBuilderTestCase<SB extends SuggestionBui
|
|||
QueryShardContext mockShardContext = new QueryShardContext(0, idxSettings, null, null, mapperService, null, scriptService,
|
||||
xContentRegistry(), null, null, System::currentTimeMillis);
|
||||
|
||||
for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) {
|
||||
SB suggestionBuilder = randomTestBuilder();
|
||||
SuggestionContext suggestionContext = suggestionBuilder.build(mockShardContext);
|
||||
assertEquals(toBytesRef(suggestionBuilder.text()), suggestionContext.getText());
|
||||
if (suggestionBuilder.text() != null && suggestionBuilder.prefix() == null) {
|
||||
|
|
Loading…
Reference in New Issue