import akka.actor.ActorSystem;
import akka.actor.DeadLetter;
import akka.actor.Props;
-import akka.actor.UntypedActor;
+import akka.actor.UntypedAbstractActor;
import akka.testkit.TestKit;
import com.typesafe.config.ConfigFactory;
import java.util.concurrent.TimeUnit;
private final ReentrantLock lock = new ReentrantLock();
@BeforeClass
- public static void setUp() throws Exception {
+ public static void setUp() {
config = new CommonConfig.Builder<>("testsystem").withConfigReader(ConfigFactory::load).build();
actorSystem = ActorSystem.create("testsystem", config.get());
}
@AfterClass
- public static void tearDown() throws Exception {
+ public static void tearDown() {
if (actorSystem != null) {
actorSystem.terminate();
actorSystem = null;
}
@Test
- public void shouldSendMsgToDeadLetterWhenQueueIsFull() throws InterruptedException {
+ public void shouldSendMsgToDeadLetterWhenQueueIsFull() {
final TestKit mockReceiver = new TestKit(actorSystem);
actorSystem.eventStream().subscribe(mockReceiver.testActor(), DeadLetter.class);
/**
* For testing.
*/
- public static class PingPongActor extends UntypedActor {
+ public static class PingPongActor extends UntypedAbstractActor {
ReentrantLock lock;
}
@Override
- public void onReceive(final Object message) throws Exception {
+ public void onReceive(final Object message) {
lock.lock();
try {
if ("ping".equals(message)) {