Skip to content

Commit

Permalink
Add basic UT
Browse files Browse the repository at this point in the history
Signed-off-by: Rishab Nahata <rnnahata@amazon.com>
  • Loading branch information
imRishN committed Sep 26, 2022
1 parent c9e0f5b commit bb0547d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,14 @@ public void testReconnectsToDisconnectedNodes() {
assertFoundPeers(rebootedOtherNode);
}

public void testNodeCommissioning() {
peerFinder.nodeCommissionedListener().onFailure(new Exception("unit-test"));
assertTrue(peerFinder.localNodeDecommissioned());

peerFinder.nodeCommissionedListener().onResponse(null);
assertFalse(peerFinder.localNodeDecommissioned());
}

private void respondToRequests(Function<DiscoveryNode, PeersResponse> responseFactory) {
final CapturedRequest[] capturedRequests = capturingTransport.getCapturedRequestsAndClear();
for (final CapturedRequest capturedRequest : capturedRequests) {
Expand Down

0 comments on commit bb0547d

Please sign in to comment.