import akka.actor.Terminated;
import akka.dispatch.ExecutionContexts;
import akka.dispatch.Futures;
-import akka.testkit.JavaTestKit;
+import akka.testkit.javadsl.TestKit;
import akka.util.Timeout;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Uninterruptibles;
@Test(timeout = 10000)
public void testSuccessfulRegistration() {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ActorContext actorContext = new ActorContext(getSystem(), getRef(), mock(ClusterWrapper.class),
mock(Configuration.class));
@Test(timeout = 10000)
public void testSuccessfulRegistrationForClusteredListener() {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ActorContext actorContext = new ActorContext(getSystem(), getRef(), mock(ClusterWrapper.class),
mock(Configuration.class));
@Test(timeout = 10000)
public void testLocalShardNotFound() {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ActorContext actorContext = new ActorContext(getSystem(), getRef(), mock(ClusterWrapper.class),
mock(Configuration.class));
@Test(timeout = 10000)
public void testLocalShardNotInitialized() {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ActorContext actorContext = new ActorContext(getSystem(), getRef(), mock(ClusterWrapper.class),
mock(Configuration.class));
reply(new NotInitializedException("not initialized"));
- new Within(duration("1 seconds")) {
- @Override
- protected void run() {
- expectNoMsg();
- }
- };
+ within(duration("1 seconds"), () -> {
+ expectNoMsg();
+ return null;
+ });
proxy.close();
}
@Test
public void testFailedRegistration() {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ActorSystem mockActorSystem = mock(ActorSystem.class);
@Test
public void testCloseBeforeRegistration() {
- new JavaTestKit(getSystem()) {
+ new TestKit(getSystem()) {
{
ActorContext actorContext = mock(ActorContext.class);