[TEST] delete specific index boost serialization test, already covered by testSerialization
indexBoost is already randomly set, we don't need a specific test for it in SearchSourceBuilderTests
This commit is contained in:
parent
20badcdbab
commit
7097f4943c
|
@ -326,25 +326,4 @@ public class SearchSourceBuilderTests extends AbstractSearchTestCase {
|
||||||
String query = "{ \"query\": {} }";
|
String query = "{ \"query\": {} }";
|
||||||
assertParseSearchSource(builder, new BytesArray(query), ParseFieldMatcher.EMPTY);
|
assertParseSearchSource(builder, new BytesArray(query), ParseFieldMatcher.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSearchRequestBuilderSerializationWithIndexBoost() throws Exception {
|
|
||||||
SearchSourceBuilder searchSourceBuilder = createSearchSourceBuilder();
|
|
||||||
createIndexBoost(searchSourceBuilder);
|
|
||||||
try (BytesStreamOutput output = new BytesStreamOutput()) {
|
|
||||||
searchSourceBuilder.writeTo(output);
|
|
||||||
try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(), namedWriteableRegistry)) {
|
|
||||||
SearchSourceBuilder deserializedSearchSourceBuilder = new SearchSourceBuilder(in);
|
|
||||||
BytesStreamOutput deserializedOutput = new BytesStreamOutput();
|
|
||||||
deserializedSearchSourceBuilder.writeTo(deserializedOutput);
|
|
||||||
assertEquals(output.bytes(), deserializedOutput.bytes());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void createIndexBoost(SearchSourceBuilder searchSourceBuilder) {
|
|
||||||
int indexBoostSize = randomIntBetween(1, 10);
|
|
||||||
for (int i = 0; i < indexBoostSize; i++) {
|
|
||||||
searchSourceBuilder.indexBoost(randomAsciiOfLengthBetween(5, 20), randomFloat() * 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue