import static org.mockito.Mockito.when;
import akka.actor.ActorSystem;
-import akka.testkit.JavaTestKit;
import akka.testkit.TestProbe;
+import akka.testkit.javadsl.TestKit;
import com.google.common.base.Ticker;
import com.google.common.primitives.UnsignedLong;
import java.util.ArrayList;
tester = new TransactionTester<>(transaction, connection, backendProbe);
}
+ @SuppressWarnings("checkstyle:hiddenField")
protected abstract T createTransaction(ProxyHistory parent, TransactionIdentifier id, DataTreeSnapshot snapshot);
@After
public void tearDown() throws Exception {
- JavaTestKit.shutdownActorSystem(system);
+ TestKit.shutdownActorSystem(system);
}
@Test
transaction.startReconnect();
final ProxyHistory mockSuccessor = mock(ProxyHistory.class);
- when(mockSuccessor.createTransactionProxy(TRANSACTION_ID, transaction.isSnapshotOnly()))
+ when(mockSuccessor.createTransactionProxy(TRANSACTION_ID, transaction.isSnapshotOnly(), false))
.thenReturn(successor.getTransaction());
transaction.replayMessages(mockSuccessor, entries);
Assert.assertThat(modifications, hasItem(both(isA(TransactionDelete.class)).and(hasPath(PATH_3))));
}
+ @SuppressWarnings("checkstyle:hiddenField")
protected <R extends TransactionRequest<R>> void testRequestResponse(final Consumer<VotingFuture<Void>> consumer,
final Class<R> expectedRequest,
final BiFunction<TransactionIdentifier, Long, TransactionSuccess<?>> replySupplier) throws Exception {
return new TestProbe(system);
}
+ @SuppressWarnings("checkstyle:hiddenField")
protected TransactionTester<LocalReadWriteProxyTransaction> createLocalProxy() {
final TestProbe backendProbe = new TestProbe(system, "backend2");
final TestProbe clientContextProbe = new TestProbe(system, "clientContext2");
return new TransactionTester<>(tx, connection, backendProbe);
}
+ @SuppressWarnings("checkstyle:hiddenField")
protected TransactionTester<RemoteProxyTransaction> createRemoteProxyTransactionTester() {
final TestProbe clientContextProbe = new TestProbe(system, "remoteClientContext");
final TestProbe backendProbe = new TestProbe(system, "remoteBackend");
AccessClientUtil.createConnectedConnection(context, 0L, backend);
final ProxyHistory proxyHistory = ProxyHistory.createClient(history, connection, HISTORY_ID);
final RemoteProxyTransaction transaction =
- new RemoteProxyTransaction(proxyHistory, TRANSACTION_ID, false, false);
+ new RemoteProxyTransaction(proxyHistory, TRANSACTION_ID, false, false, false);
return new TransactionTester<>(transaction, connection, backendProbe);
}
}