Skip to content

Commit

Permalink
Remove Version from MainResponseTests (elastic#100101)
Browse files Browse the repository at this point in the history
Version values can be arbitrary strings for MainResponseTests. If it turns out that we need test values that look like semantic versions, we can add those back in once we have a use case, but in general Build should be able to support arbitrary version identifiers.
  • Loading branch information
williamrandolph authored and jakelandis committed Oct 2, 2023
1 parent c2be005 commit bd00489
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.index.IndexVersion;
import org.elasticsearch.test.AbstractXContentSerializingTestCase;
import org.elasticsearch.test.VersionUtils;
import org.elasticsearch.test.index.IndexVersionUtils;
import org.elasticsearch.xcontent.ToXContent;
import org.elasticsearch.xcontent.XContentBuilder;
Expand All @@ -35,19 +34,19 @@ protected MainResponse createTestInstance() {
String clusterUuid = randomAlphaOfLength(10);
ClusterName clusterName = new ClusterName(randomAlphaOfLength(10));
String nodeName = randomAlphaOfLength(10);
Version version = VersionUtils.randomCompatibleVersion(random(), Version.CURRENT);
String versionString = randomAlphaOfLength(10);
IndexVersion indexVersion = IndexVersionUtils.randomVersion();
Build build = newBuild(
Build.current(),
Map.of(
"version",
version.toString(),
versionString,
"minWireCompatVersion",
version.minimumCompatibilityVersion().toString(),
randomAlphaOfLength(10),
"minIndexCompatVersion",
Build.minimumCompatString(IndexVersion.getMinimumCompatibleIndexVersion(indexVersion.id())),
"displayString",
Build.defaultDisplayString(Build.current().type(), Build.current().hash(), Build.current().date(), version.toString())
Build.defaultDisplayString(Build.current().type(), Build.current().hash(), Build.current().date(), versionString)
)
);
return new MainResponse(nodeName, indexVersion.luceneVersion().toString(), clusterName, clusterUuid, build);
Expand Down

0 comments on commit bd00489

Please sign in to comment.