expectNoMsg() has been deprecated, move to its replacement.
Change-Id: I51fc5dc28fd8131b76ca00d254de06403e06de69
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
probe.expectMsgClass(MockedSnapshotStore.DeleteByCriteriaRequest.class);
probe.reply(new RuntimeException("delete failed"));
//actor shouldn't terminate
probe.expectMsgClass(MockedSnapshotStore.DeleteByCriteriaRequest.class);
probe.reply(new RuntimeException("delete failed"));
//actor shouldn't terminate
+ probe.expectNoMessage();
}
@SuppressWarnings("unchecked")
}
@SuppressWarnings("unchecked")
final Consumer<Response<?, ?>> callback = mock(Consumer.class);
final Request<?, ?> request = createRequest(replyToProbe.ref());
connection.sendRequest(request, callback);
final Consumer<Response<?, ?>> callback = mock(Consumer.class);
final Request<?, ?> request = createRequest(replyToProbe.ref());
connection.sendRequest(request, callback);
- backendProbe.expectNoMsg();
+ backendProbe.expectNoMessage();
final LocalHistoryIdentifier historyId = new LocalHistoryIdentifier(CLIENT_ID, 0L);
final RequestSuccess<?, ?> message = new TransactionAbortSuccess(new TransactionIdentifier(historyId, 0L), 0L);
final ResponseEnvelope<?> envelope = new SuccessEnvelope(message, 0L, 0L, 0L);
final LocalHistoryIdentifier historyId = new LocalHistoryIdentifier(CLIENT_ID, 0L);
final RequestSuccess<?, ?> message = new TransactionAbortSuccess(new TransactionIdentifier(historyId, 0L), 0L);
final ResponseEnvelope<?> envelope = new SuccessEnvelope(message, 0L, 0L, 0L);
for (int i = 0; i < getMaxInFlightMessages(); i++) {
probe.expectMsgClass(RequestEnvelope.class);
}
for (int i = 0; i < getMaxInFlightMessages(); i++) {
probe.expectMsgClass(RequestEnvelope.class);
}
+ probe.expectNoMessage();
final Collection<ConnectionEntry> entries = queue.drain();
assertEquals(sentMessages, entries.size());
assertThat(entries, everyItem(entryWithRequest(request)));
final Collection<ConnectionEntry> entries = queue.drain();
assertEquals(sentMessages, entries.size());
assertThat(entries, everyItem(entryWithRequest(request)));
final Request<?, ?> request2 = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 1L, probe.ref());
queue.enqueueOrForward(new ConnectionEntry(request2, mockConsumer, now), now);
verifyNoMoreInteractions(mockMessageSlicer);
final Request<?, ?> request2 = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 1L, probe.ref());
queue.enqueueOrForward(new ConnectionEntry(request2, mockConsumer, now), now);
verifyNoMoreInteractions(mockMessageSlicer);
+ probe.expectNoMessage();
RequestEnvelope requestEnvelope = (RequestEnvelope) sliceOptions.getValue().getMessage();
queue.complete(new FailureEnvelope(request.toRequestFailure(mock(RequestException.class)),
RequestEnvelope requestEnvelope = (RequestEnvelope) sliceOptions.getValue().getMessage();
queue.complete(new FailureEnvelope(request.toRequestFailure(mock(RequestException.class)),
subject.tell(new DataTreeChanged(mockCandidates), getRef());
within(duration("1 seconds"), () -> {
subject.tell(new DataTreeChanged(mockCandidates), getRef());
within(duration("1 seconds"), () -> {
Mockito.verify(mockListener, Mockito.never())
.onDataTreeChanged(Matchers.anyCollectionOf(DataTreeCandidate.class));
return null;
Mockito.verify(mockListener, Mockito.never())
.onDataTreeChanged(Matchers.anyCollectionOf(DataTreeCandidate.class));
return null;
reply(new LocalShardNotFound("shard-1"));
reply(new LocalShardNotFound("shard-1"));
- expectNoMsg(duration("1 seconds"));
+ expectNoMessage(duration("1 seconds"));
reply(new NotInitializedException("not initialized"));
within(duration("1 seconds"), () -> {
reply(new NotInitializedException("not initialized"));
within(duration("1 seconds"), () -> {
}
private void sendReply(final Object message) {
}
private void sendReply(final Object message) {
ImmutableSet.copyOf(candidateAdded.getAllCandidates()));
writeNode(ENTITY_OWNERS_PATH, entityOwnersWithCandidate(ENTITY_TYPE, ENTITY_ID1, memberName1));
ImmutableSet.copyOf(candidateAdded.getAllCandidates()));
writeNode(ENTITY_OWNERS_PATH, entityOwnersWithCandidate(ENTITY_TYPE, ENTITY_ID1, memberName1));
- kit.expectNoMsg(FiniteDuration.create(500, TimeUnit.MILLISECONDS));
+ kit.expectNoMessage(FiniteDuration.create(500, TimeUnit.MILLISECONDS));
String memberName2 = "member-2";
writeNode(ENTITY_OWNERS_PATH, entityOwnersWithCandidate(ENTITY_TYPE, ENTITY_ID1, memberName2));
String memberName2 = "member-2";
writeNode(ENTITY_OWNERS_PATH, entityOwnersWithCandidate(ENTITY_TYPE, ENTITY_ID1, memberName2));
Snapshot.create(shard2SnapshotState, Collections.<ReplicatedLogEntry>emptyList(),
2, 1, 2, 1, 1, "member-1", null)), ActorRef.noSender());
Snapshot.create(shard2SnapshotState, Collections.<ReplicatedLogEntry>emptyList(),
2, 1, 2, 1, 1, "member-1", null)), ActorRef.noSender());
- kit.expectNoMsg(FiniteDuration.create(500, TimeUnit.MILLISECONDS));
+ kit.expectNoMessage(FiniteDuration.create(500, TimeUnit.MILLISECONDS));
ByteState shard3SnapshotState = ByteState.of(new byte[]{7,8,9});
replyActor.tell(new GetSnapshotReply(ShardIdentifier.create("shard3", MEMBER_1, "config").toString(),
ByteState shard3SnapshotState = ByteState.of(new byte[]{7,8,9});
replyActor.tell(new GetSnapshotReply(ShardIdentifier.create("shard3", MEMBER_1, "config").toString(),
// RoleChangeNotification.
shardManager.tell(new FindPrimary(Shard.DEFAULT_NAME, true), getRef());
// RoleChangeNotification.
shardManager.tell(new FindPrimary(Shard.DEFAULT_NAME, true), getRef());
- expectNoMsg(FiniteDuration.create(150, TimeUnit.MILLISECONDS));
+ expectNoMessage(FiniteDuration.create(150, TimeUnit.MILLISECONDS));
shardManager.tell(new ActorInitialized(), mockShardActor);
shardManager.tell(new ActorInitialized(), mockShardActor);
- expectNoMsg(FiniteDuration.create(150, TimeUnit.MILLISECONDS));
+ expectNoMessage(FiniteDuration.create(150, TimeUnit.MILLISECONDS));
String memberId = "member-1-shard-default-" + shardMrgIDSuffix;
shardManager.tell(
new RoleChangeNotification(memberId, RaftState.Candidate.name(), RaftState.Leader.name()),
mockShardActor);
String memberId = "member-1-shard-default-" + shardMrgIDSuffix;
shardManager.tell(
new RoleChangeNotification(memberId, RaftState.Candidate.name(), RaftState.Leader.name()),
mockShardActor);
- expectNoMsg(FiniteDuration.create(150, TimeUnit.MILLISECONDS));
+ expectNoMessage(FiniteDuration.create(150, TimeUnit.MILLISECONDS));
DataTree mockDataTree = mock(DataTree.class);
shardManager.tell(new ShardLeaderStateChanged(memberId, memberId, mockDataTree,
DataTree mockDataTree = mock(DataTree.class);
shardManager.tell(new ShardLeaderStateChanged(memberId, memberId, mockDataTree,
primaryFound.getPrimaryPath().contains("member-1-shard-default"));
assertSame("getLocalShardDataTree", mockDataTree, primaryFound.getLocalShardDataTree());
primaryFound.getPrimaryPath().contains("member-1-shard-default"));
assertSame("getLocalShardDataTree", mockDataTree, primaryFound.getLocalShardDataTree());
- expectNoMsg(FiniteDuration.create(200, TimeUnit.MILLISECONDS));
+ expectNoMessage(FiniteDuration.create(200, TimeUnit.MILLISECONDS));
shardManager.tell(new ActorInitialized(), mockShardActor);
shardManager.tell(new ActorInitialized(), mockShardActor);
- expectNoMsg(FiniteDuration.create(200, TimeUnit.MILLISECONDS));
+ expectNoMessage(FiniteDuration.create(200, TimeUnit.MILLISECONDS));
assertEquals(shardActorRef, out.get());
assertEquals(shardActorRef, out.get());