[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:
javanna 2016-09-16 11:11:24 +02:00 committed by Luca Cavanna
parent 20badcdbab
commit 7097f4943c
1 changed files with 0 additions and 21 deletions

View File

@ -326,25 +326,4 @@ public class SearchSourceBuilderTests extends AbstractSearchTestCase {
String query = "{ \"query\": {} }";
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);
}
}
}