import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import akka.actor.ExtendedActorSystem;
import akka.testkit.javadsl.TestKit;
+import com.google.common.collect.ImmutableSortedSet;
import java.io.NotSerializableException;
import java.util.List;
+import java.util.Optional;
+import java.util.SortedSet;
import org.junit.Test;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.AbstractTest;
MapNode mergeData = ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME).build();
new MergeModification(TestModel.OUTER_LIST_PATH, mergeData).apply(modification);
+ final SortedSet<String> shardNames = ImmutableSortedSet.of("one", "two");
TransactionIdentifier txId = nextTransactionId();
- ReadyLocalTransaction readyMessage = new ReadyLocalTransaction(txId, modification, true);
+ ReadyLocalTransaction readyMessage = new ReadyLocalTransaction(txId, modification, true,
+ Optional.of(shardNames));
final ExtendedActorSystem system = (ExtendedActorSystem) ExtendedActorSystem.create("test");
final Object deserialized;
BatchedModifications batched = (BatchedModifications)deserialized;
assertEquals("getTransactionID", txId, batched.getTransactionId());
assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, batched.getVersion());
+ assertTrue("isReady", batched.isReady());
+ assertTrue("isDoCommitOnReady", batched.isDoCommitOnReady());
+ assertTrue("participatingShardNames present", batched.getParticipatingShardNames().isPresent());
+ assertEquals("participatingShardNames", shardNames, batched.getParticipatingShardNames().get());
List<Modification> batchedMods = batched.getModifications();
assertEquals("getModifications size", 2, batchedMods.size());