import akka.persistence.RecoveryCompleted;
import akka.persistence.SnapshotMetadata;
import akka.persistence.SnapshotOffer;
+import akka.testkit.javadsl.TestKit;
import com.google.common.util.concurrent.MoreExecutors;
import java.io.OutputStream;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
+import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
context.setReplicatedLog(ReplicatedLogImpl.newInstance(context));
}
+ @After
+ public void tearDown() {
+ TestKit.shutdownActorSystem(mockActorSystem);
+ }
+
private void sendMessageToSupport(final Object message) {
sendMessageToSupport(message, false);
}
CreateTransactionReply.class);
final String path = reply.getTransactionPath().toString();
- assertTrue("Unexpected transaction path " + path, path.startsWith(String.format(
- "akka://test/user/testCreateTransaction/shard-%s-%s:ShardTransactionTest@0:",
+ assertTrue("Unexpected transaction path " + path, path.contains(String.format(
+ "/user/testCreateTransaction/shard-%s-%s:ShardTransactionTest@0:",
shardID.getShardName(), shardID.getMemberName().getName())));
}
CreateTransactionReply.class);
final String path = reply.getTransactionPath().toString();
- assertTrue("Unexpected transaction path " + path, path.startsWith(String.format(
- "akka://test/user/testCreateTransactionOnChain/shard-%s-%s:ShardTransactionTest@0:",
+ assertTrue("Unexpected transaction path " + path, path.contains(String.format(
+ "/user/testCreateTransactionOnChain/shard-%s-%s:ShardTransactionTest@0:",
shardID.getShardName(), shardID.getMemberName().getName())));
}
ImmutableNodes.containerNode(TestModel.TEST_QNAME), false), testKit.getRef());
final ReadyTransactionReply readyReply = ReadyTransactionReply
.fromSerializable(testKit.expectMsgClass(duration, ReadyTransactionReply.class));
- assertEquals("Cohort path", shard.path().toString(), readyReply.getCohortPath());
+
+ String pathSuffix = shard.path().toString().replaceFirst("akka://test", "");
+ assertTrue("Cohort path", readyReply.getCohortPath().endsWith(pathSuffix));
// Send the CanCommitTransaction message for the first Tx.
shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), testKit.getRef());
import akka.testkit.javadsl.TestKit;
import akka.util.Timeout;
import com.google.common.collect.Lists;
+import com.typesafe.config.ConfigFactory;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@Before
public void setUp() {
- system = ActorSystem.create("test");
+ system = ActorSystem.create("test", ConfigFactory.load().getConfig("unit-test"));
final DOMActionInstance emptyActionIdentifier = DOMActionInstance.of(
REMOTE_SCHEMA_PATH, LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty());
import akka.testkit.javadsl.TestKit;
import akka.util.Timeout;
import com.google.common.collect.Lists;
+import com.typesafe.config.ConfigFactory;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@Before
public void setUp() {
- system = ActorSystem.create("test");
+ system = ActorSystem.create("test", ConfigFactory.load().getConfig("unit-test"));
final DOMRpcIdentifier emptyRpcIdentifier = DOMRpcIdentifier.create(
REMOTE_QNAME, YangInstanceIdentifier.empty());