import static org.junit.Assert.assertSame;
import akka.actor.ActorRef;
+import akka.actor.Scheduler;
+import akka.dispatch.Dispatcher;
import com.google.common.base.Ticker;
import org.junit.Before;
import org.junit.Test;
@Mock
private ActorRef mockSelf;
+ @Mock
+ private Scheduler mockScheduler;
+
+ @Mock
+ private Dispatcher mockDispatcher;
+
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
@Test
public void testMockingControl() {
- ClientActorContext ctx = new ClientActorContext(mockSelf, PERSISTENCE_ID, CLIENT_ID);
+ ClientActorContext ctx = new ClientActorContext(mockSelf, mockScheduler, mockDispatcher, PERSISTENCE_ID, CLIENT_ID);
assertSame(CLIENT_ID, ctx.getIdentifier());
assertSame(PERSISTENCE_ID, ctx.persistenceId());
assertSame(mockSelf, ctx.self());
@Test
public void testTicker() {
- ClientActorContext ctx = new ClientActorContext(mockSelf, PERSISTENCE_ID, CLIENT_ID);
+ ClientActorContext ctx = new ClientActorContext(mockSelf, mockScheduler, mockDispatcher, PERSISTENCE_ID, CLIENT_ID);
assertSame(Ticker.systemTicker(), ctx.ticker());
}
}