import akka.actor.ActorRef;
import akka.actor.ActorSelection;
import akka.actor.ActorSystem;
-import akka.testkit.JavaTestKit;
import akka.testkit.TestProbe;
+import akka.testkit.javadsl.TestKit;
import java.util.Collections;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutionException;
private DataTree dataTree;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
MockitoAnnotations.initMocks(this);
system = ActorSystem.apply();
contextProbe = new TestProbe(system, "context");
}
@After
- public void tearDown() throws Exception {
- JavaTestKit.shutdownActorSystem(system);
+ public void tearDown() {
+ TestKit.shutdownActorSystem(system);
}
@Test
- public void testResolveShardForPathNonNullCookie() throws Exception {
+ public void testResolveShardForPathNonNullCookie() {
when(shardStrategy.findShard(YangInstanceIdentifier.EMPTY)).thenReturn("default");
final Long cookie = moduleShardBackendResolver.resolveShardForPath(YangInstanceIdentifier.EMPTY);
Assert.assertEquals(0L, cookie.longValue());
}
@Test
- public void testResolveShardForPathNullCookie() throws Exception {
+ public void testResolveShardForPathNullCookie() {
when(shardStrategy.findShard(YangInstanceIdentifier.EMPTY)).thenReturn("foo");
final Long cookie = moduleShardBackendResolver.resolveShardForPath(YangInstanceIdentifier.EMPTY);
Assert.assertEquals(1L, cookie.longValue());