*/
package org.opendaylight.controller.cluster.databroker.actors.dds;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
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.Collection;
import java.util.Collections;
import java.util.function.Function;
handle = createHandle(parent);
}
+ @SuppressWarnings("checkstyle:hiddenField")
protected abstract T createHandle(AbstractClientHistory parent);
/**
*
* @param handle handle
*/
+ @SuppressWarnings("checkstyle:hiddenField")
protected abstract void doHandleOperation(T handle);
@After
- public void tearDown() throws Exception {
- JavaTestKit.shutdownActorSystem(system);
+ public void tearDown() {
+ TestKit.shutdownActorSystem(system);
}
@Test
- public void testGetIdentifier() throws Exception {
+ public void testGetIdentifier() {
Assert.assertEquals(TRANSACTION_ID, handle.getIdentifier());
}
}
@Test
- public void testEnsureClosed() throws Exception {
+ public void testEnsureClosed() {
doHandleOperation(handle);
final Collection<AbstractProxyTransaction> transactions = handle.ensureClosed();
Assert.assertNotNull(transactions);
}
@Test
- public void testEnsureProxy() throws Exception {
+ public void testEnsureProxy() {
final Function<Long, AbstractProxyTransaction> function = mock(Function.class);
final AbstractProxyTransaction expected = mock(AbstractProxyTransaction.class);
when(function.apply(0L)).thenReturn(expected);
}
@Test
- public void testParent() throws Exception {
+ public void testParent() {
Assert.assertEquals(parent, handle.parent());
}
* @param <R> expected request type
* @return request message
*/
- protected <R extends Request<?, ?>> R backendRespondToRequest(final Class<R> expectedRequestClass,
+ protected <R extends Request<?, R>> R backendRespondToRequest(final Class<R> expectedRequestClass,
final Response<?, ?> response) {
final RequestEnvelope envelope = backendProbe.expectMsgClass(RequestEnvelope.class);
Assert.assertEquals(expectedRequestClass, envelope.getMessage().getClass());
return mock;
}
-}
\ No newline at end of file
+}