ibessonov commented on code in PR #1411:
URL: https://github.com/apache/ignite-3/pull/1411#discussion_r1043288980
##########
modules/raft/src/testFixtures/java/org/apache/ignite/raft/server/counter/IncrementAndGetCommand.java:
##########
@@ -18,29 +18,22 @@
package org.apache.ignite.raft.server.counter;
import org.apache.ignite.internal.raft.WriteCommand;
+import org.apache.ignite.network.annotations.Transferable;
+import org.apache.ignite.raft.messages.TestMessageGroup;
+import org.apache.ignite.raft.messages.TestRaftMessagesFactory;
/**
* Increment and get command.
*/
-public class IncrementAndGetCommand implements WriteCommand {
- /**
- * The delta.
- */
- private final long delta;
-
- /**
- * Constructor.
- *
- * @param delta The delta.
- */
- public IncrementAndGetCommand(long delta) {
- this.delta = delta;
- }
-
+//TODO Move to integration test directory when Maven build is not supported
anymore.
+@Transferable(TestMessageGroup.INCREMENT_AND_GET_COMMAND)
+public interface IncrementAndGetCommand extends WriteCommand {
/**
* Returns the delta.
*/
- public long delta() {
- return delta;
+ long delta();
+
+ static IncrementAndGetCommand incrementAndGetCommand(long delta) {
Review Comment:
For convenience. It's much easier this way, otherwise we'll have a lot of
boilerplate in tests
##########
modules/raft/src/testFixtures/java/org/apache/ignite/raft/server/counter/IncrementAndGetCommand.java:
##########
@@ -18,29 +18,22 @@
package org.apache.ignite.raft.server.counter;
import org.apache.ignite.internal.raft.WriteCommand;
+import org.apache.ignite.network.annotations.Transferable;
+import org.apache.ignite.raft.messages.TestMessageGroup;
+import org.apache.ignite.raft.messages.TestRaftMessagesFactory;
/**
* Increment and get command.
*/
-public class IncrementAndGetCommand implements WriteCommand {
- /**
- * The delta.
- */
- private final long delta;
-
- /**
- * Constructor.
- *
- * @param delta The delta.
- */
- public IncrementAndGetCommand(long delta) {
- this.delta = delta;
- }
-
+//TODO Move to integration test directory when Maven build is not supported
anymore.
Review Comment:
I'll add it, thank you
--
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]