pekko/akka-actor-tests/src/test/java/akka/actor/StashJavaAPI.java

27 lines
702 B
Java
Raw Normal View History

package akka.actor;
import akka.testkit.AkkaJUnitActorSystemResource;
import org.junit.ClassRule;
import org.junit.Test;
import com.typesafe.config.ConfigFactory;
public class StashJavaAPI {
@ClassRule
public static AkkaJUnitActorSystemResource actorSystemResource =
new AkkaJUnitActorSystemResource("StashJavaAPI", ActorWithBoundedStashSpec.testConf());
private final ActorSystem system = actorSystemResource.getSystem();
@Test
public void mustBeAbleToUseStash() {
ActorRef ref = system.actorOf(Props.create(StashJavaAPITestActor.class)
.withDispatcher("my-dispatcher"));
ref.tell("Hello", ref);
ref.tell("Hello", ref);
ref.tell(new Object(), null);
}
}