[TEST] Set proper version on InputStream

This commit is contained in:
Yannick Welsch 2017-07-25 10:11:06 +02:00
parent 7868373069
commit 7e08753bd2
1 changed files with 1 additions and 1 deletions

View File

@ -142,8 +142,8 @@ public class ClusterSerializationTests extends ESAllocationTestCase {
outStream.setVersion(Version.CURRENT.minimumIndexCompatibilityVersion()); outStream.setVersion(Version.CURRENT.minimumIndexCompatibilityVersion());
diffs.writeTo(outStream); diffs.writeTo(outStream);
inStream = outStream.bytes().streamInput(); inStream = outStream.bytes().streamInput();
inStream.setVersion(outStream.getVersion());
inStream = new NamedWriteableAwareStreamInput(inStream, new NamedWriteableRegistry(ClusterModule.getNamedWriteables())); inStream = new NamedWriteableAwareStreamInput(inStream, new NamedWriteableRegistry(ClusterModule.getNamedWriteables()));
inStream.setVersion(outStream.getVersion());
serializedDiffs = ClusterState.readDiffFrom(inStream, clusterState.nodes().getLocalNode()); serializedDiffs = ClusterState.readDiffFrom(inStream, clusterState.nodes().getLocalNode());
stateAfterDiffs = serializedDiffs.apply(ClusterState.EMPTY_STATE); stateAfterDiffs = serializedDiffs.apply(ClusterState.EMPTY_STATE);
assertThat(stateAfterDiffs.custom(RestoreInProgress.TYPE), includeRestore ? notNullValue() : nullValue()); assertThat(stateAfterDiffs.custom(RestoreInProgress.TYPE), includeRestore ? notNullValue() : nullValue());