Skip to content

Commit cb3110c

Browse files
committed
fix QuerySearchResultTests
Signed-off-by: Nicholas Walter Knize <[email protected]>
1 parent 4da78fb commit cb3110c

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

server/src/test/java/org/opensearch/search/query/QuerySearchResultTests.java

-33
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,27 @@
3535
import org.apache.lucene.search.ScoreDoc;
3636
import org.apache.lucene.search.TopDocs;
3737
import org.apache.lucene.search.TotalHits;
38-
import org.opensearch.LegacyESVersion;
3938
import org.opensearch.Version;
4039
import org.opensearch.action.OriginalIndices;
4140
import org.opensearch.action.OriginalIndicesTests;
4241
import org.opensearch.action.search.SearchRequest;
4342
import org.opensearch.common.Strings;
4443
import org.opensearch.common.UUIDs;
45-
import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput;
4644
import org.opensearch.common.io.stream.NamedWriteableRegistry;
47-
import org.opensearch.common.io.stream.StreamInput;
4845
import org.opensearch.common.lucene.search.TopDocsAndMaxScore;
4946
import org.opensearch.common.settings.Settings;
5047
import org.opensearch.index.shard.ShardId;
5148
import org.opensearch.search.DocValueFormat;
5249
import org.opensearch.search.SearchModule;
5350
import org.opensearch.search.SearchShardTarget;
5451
import org.opensearch.search.aggregations.Aggregations;
55-
import org.opensearch.search.aggregations.InternalAggregations;
5652
import org.opensearch.search.aggregations.InternalAggregationsTests;
5753
import org.opensearch.search.internal.AliasFilter;
5854
import org.opensearch.search.internal.ShardSearchContextId;
5955
import org.opensearch.search.internal.ShardSearchRequest;
6056
import org.opensearch.search.suggest.SuggestTests;
6157
import org.opensearch.test.OpenSearchTestCase;
6258

63-
import java.io.IOException;
64-
import java.util.Base64;
65-
6659
import static java.util.Collections.emptyList;
6760

6861
public class QuerySearchResultTests extends OpenSearchTestCase {
@@ -127,32 +120,6 @@ public void testSerialization() throws Exception {
127120
assertEquals(querySearchResult.terminatedEarly(), deserialized.terminatedEarly());
128121
}
129122

130-
public void testReadFromPre_7_1_0() throws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m9jT05aZmZ4ZmUmAAAAAAAAA30AAApvb0tJTkdvbHdzBnN0ZXJtcwVtRmlmZAoAAAEDAfoNA3JhdwUBAARXAAAAAAAAA30AAApZ"
140-
+ "d3BwQlpBZEhpMQAAAAAAAAN9AAAKREZ3UVpTSXhDSE4AAAAAAAADfQAAClVMZW1YZGtkSHUUAAAAAAAAA30AAApBUVdKVk1kTlF1BnN0ZXJtcwVxbkJGVgoAA"
141-
+ "AEDAfoNA3JhdwUBAAYJAAAAAAAAA30AAApBS2NLU1ZVS25EIQAAAAAAAAN9AAAKWGpCbXZBZmduRhsAAAAAAAADfQAACk54TkJEV3pLRmI7AAAAAAAAA30AAA"
142-
+ "pydkdaZnJycXhWSAAAAAAAAAN9AAAKSURVZ3JhQlFHSy4AAAAAAAADfQAACmJmZ0x5YlFlVksACm5rdExLUHp3cGgBCm1heF9idWNrZXQFbmFtZTEBB2J1Y2t"
143-
+ "ldDH/A3JhdwEBCm1heF9idWNrZXQFbmFtZTEBB2J1Y2tldDH/A3JhdwEAAAIAAf////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
144-
byte[] bytes = Base64.getDecoder().decode(message);
145-
try (NamedWriteableAwareStreamInput in = new NamedWriteableAwareStreamInput(StreamInput.wrap(bytes), namedWriteableRegistry)) {
146-
in.setVersion(LegacyESVersion.V_7_0_0);
147-
QuerySearchResult querySearchResult = new QuerySearchResult(in);
148-
assertEquals(100, querySearchResult.getContextId().getId());
149-
assertTrue(querySearchResult.hasAggs());
150-
InternalAggregations aggs = querySearchResult.consumeAggs().expand();
151-
assertEquals(1, aggs.asList().size());
152-
// We deserialize and throw away top level pipeline aggs
153-
}
154-
}
155-
156123
public void testNullResponse() throws Exception {
157124
QuerySearchResult querySearchResult = QuerySearchResult.nullInstance();
158125
QuerySearchResult deserialized = copyWriteable(querySearchResult, namedWriteableRegistry, QuerySearchResult::new, Version.CURRENT);

0 commit comments

Comments
 (0)