rpuch commented on code in PR #795:
URL: https://github.com/apache/ignite-3/pull/795#discussion_r879549583
##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -240,18 +270,128 @@ void testClusterState() {
assertThat(node1.raftService.readClusterState(),
willCompleteSuccessfully());
assertThat(node2.raftService.readClusterState(),
willCompleteSuccessfully());
- ClusterState state = new ClusterState(List.of("foo"), List.of("bar"));
+ ClusterState state = new ClusterState(
+ List.of("foo"),
+ List.of("bar"),
+ IgniteProductVersion.CURRENT_VERSION,
+ new ClusterTag("cluster")
+ );
assertThat(node1.raftService.writeClusterState(state),
willCompleteSuccessfully());
assertThat(node1.raftService.readClusterState(), willBe(state));
assertThat(node2.raftService.readClusterState(), willBe(state));
- state = new ClusterState(List.of("baz"), List.of("quux"));
+ state = new ClusterState(
+ List.of("baz"),
+ List.of("quux"),
+ IgniteProductVersion.fromString("3.3.3"),
+ new ClusterTag("new cluster")
+ );
assertThat(node2.raftService.writeClusterState(state),
willCompleteSuccessfully());
assertThat(node1.raftService.readClusterState(), willBe(state));
assertThat(node2.raftService.readClusterState(), willBe(state));
}
+
+ /**
+ * Test validation of the Cluster Tag.
+ */
+ @Test
+ void testClusterTagValidation() {
+ Node node1 = cluster.get(0);
+ Node node2 = cluster.get(1);
+
+ ClusterState state = new ClusterState(
+ List.of("foo"),
+ List.of("bar"),
+ IgniteProductVersion.CURRENT_VERSION,
+ new ClusterTag("cluster")
+ );
+
+ assertThat(node1.raftService.writeClusterState(state),
willCompleteSuccessfully());
Review Comment:
To reduce the amount of noise on preparation step. Usually, the most
interesting part of a test is its 'action' part. Preparation part should be as
non-distractive as possible.
This is an optional, of course.
##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -240,18 +270,128 @@ void testClusterState() {
assertThat(node1.raftService.readClusterState(),
willCompleteSuccessfully());
assertThat(node2.raftService.readClusterState(),
willCompleteSuccessfully());
- ClusterState state = new ClusterState(List.of("foo"), List.of("bar"));
+ ClusterState state = new ClusterState(
+ List.of("foo"),
+ List.of("bar"),
+ IgniteProductVersion.CURRENT_VERSION,
+ new ClusterTag("cluster")
+ );
assertThat(node1.raftService.writeClusterState(state),
willCompleteSuccessfully());
assertThat(node1.raftService.readClusterState(), willBe(state));
assertThat(node2.raftService.readClusterState(), willBe(state));
- state = new ClusterState(List.of("baz"), List.of("quux"));
+ state = new ClusterState(
+ List.of("baz"),
+ List.of("quux"),
+ IgniteProductVersion.fromString("3.3.3"),
+ new ClusterTag("new cluster")
+ );
assertThat(node2.raftService.writeClusterState(state),
willCompleteSuccessfully());
assertThat(node1.raftService.readClusterState(), willBe(state));
assertThat(node2.raftService.readClusterState(), willBe(state));
}
+
+ /**
+ * Test validation of the Cluster Tag.
+ */
+ @Test
+ void testClusterTagValidation() {
+ Node node1 = cluster.get(0);
+ Node node2 = cluster.get(1);
+
+ ClusterState state = new ClusterState(
+ List.of("foo"),
+ List.of("bar"),
+ IgniteProductVersion.CURRENT_VERSION,
+ new ClusterTag("cluster")
+ );
+
+ assertThat(node1.raftService.writeClusterState(state),
willCompleteSuccessfully());
Review Comment:
To reduce the amount of noise on preparation step. Usually, the most
interesting part of a test is its 'action' part. Preparation part should be as
non-distractive as possible.
This is optional, of course.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]