[TEST][Monitoring] Also set StreamInput version
Sets the StreamInput's version so that it properly deserializes the incoming message. Original commit: elastic/x-pack-elasticsearch@e783fbcecc
This commit is contained in:
parent
ff725afe01
commit
d19ad8b3d1
|
@ -9,6 +9,7 @@ import org.elasticsearch.Version;
|
|||
import org.elasticsearch.action.support.PlainActionFuture;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -103,7 +104,9 @@ public class MonitoringFeatureSetTests extends ESTestCase {
|
|||
BytesStreamOutput out = new BytesStreamOutput();
|
||||
out.setVersion(serializedVersion);
|
||||
monitoringUsage.writeTo(out);
|
||||
XPackFeatureSet.Usage serializedUsage = new MonitoringFeatureSetUsage(out.bytes().streamInput());
|
||||
StreamInput in = out.bytes().streamInput();
|
||||
in.setVersion(serializedVersion);
|
||||
XPackFeatureSet.Usage serializedUsage = new MonitoringFeatureSetUsage(in);
|
||||
for (XPackFeatureSet.Usage usage : Arrays.asList(monitoringUsage, serializedUsage)) {
|
||||
assertThat(usage.name(), is(featureSet.name()));
|
||||
assertThat(usage.enabled(), is(featureSet.enabled()));
|
||||
|
|
Loading…
Reference in New Issue