Skip to content

Commit 2b5d2df

Browse files
committed
Set "for_internal_storage" param to "true" in serialization tests
1 parent 746e9cc commit 2b5d2df

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStatsTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77

88
import org.elasticsearch.common.io.stream.Writeable;
99
import org.elasticsearch.common.xcontent.DeprecationHandler;
10+
import org.elasticsearch.common.xcontent.ToXContent;
1011
import org.elasticsearch.common.xcontent.XContentFactory;
1112
import org.elasticsearch.common.xcontent.XContentParser;
1213
import org.elasticsearch.common.xcontent.XContentType;
1314
import org.elasticsearch.test.AbstractSerializingTestCase;
1415
import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContext;
1516
import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContextTests;
17+
import org.elasticsearch.xpack.core.ml.utils.ToXContentParams;
1618

1719
import java.io.IOException;
1820
import java.time.Instant;
21+
import java.util.Collections;
1922

2023
import static org.hamcrest.Matchers.closeTo;
2124
import static org.hamcrest.Matchers.equalTo;
@@ -49,6 +52,11 @@ protected DatafeedTimingStats doParseInstance(XContentParser parser) {
4952
return DatafeedTimingStats.PARSER.apply(parser, null);
5053
}
5154

55+
@Override
56+
protected ToXContent.Params getToXContentParams() {
57+
return new ToXContent.MapParams(Collections.singletonMap(ToXContentParams.FOR_INTERNAL_STORAGE, "true"));
58+
}
59+
5260
@Override
5361
protected DatafeedTimingStats mutateInstance(DatafeedTimingStats instance) throws IOException {
5462
String jobId = instance.getJobId();

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStatsTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
package org.elasticsearch.xpack.core.ml.job.process.autodetect.state;
77

88
import org.elasticsearch.common.io.stream.Writeable;
9+
import org.elasticsearch.common.xcontent.ToXContent;
910
import org.elasticsearch.common.xcontent.XContentParser;
1011
import org.elasticsearch.test.AbstractSerializingTestCase;
1112
import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContext;
1213
import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContextTests;
14+
import org.elasticsearch.xpack.core.ml.utils.ToXContentParams;
1315
import org.hamcrest.CustomTypeSafeMatcher;
1416
import org.hamcrest.Matcher;
1517

1618
import java.time.Instant;
19+
import java.util.Collections;
1720

1821
import static org.hamcrest.Matchers.closeTo;
1922
import static org.hamcrest.Matchers.equalTo;
@@ -49,6 +52,11 @@ protected TimingStats doParseInstance(XContentParser parser) {
4952
return TimingStats.PARSER.apply(parser, null);
5053
}
5154

55+
@Override
56+
protected ToXContent.Params getToXContentParams() {
57+
return new ToXContent.MapParams(Collections.singletonMap(ToXContentParams.FOR_INTERNAL_STORAGE, "true"));
58+
}
59+
5260
public void testDefaultConstructor() {
5361
TimingStats stats = new TimingStats(JOB_ID);
5462

0 commit comments

Comments
 (0)