mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
[TESTS] Update remove validation with BroadcastMessage type
Make the remove validation more robust by asserting that the correct remove message is broadcast. This will provide a better safety net when combining the remove functions.
This commit is contained in:
parent
289788e374
commit
53b5feb7a0
1 changed files with 6 additions and 2 deletions
|
@ -392,8 +392,12 @@ public class P2PDataStorageTest {
|
|||
if (expectedSeqNrWriteOnStateChange)
|
||||
verifySequenceNumberMapWriteContains(currentState, P2PDataStorage.get32ByteHashAsByteArray(protectedStorageEntry.getProtectedStoragePayload()), protectedStorageEntry.getSequenceNumber());
|
||||
|
||||
if (expectedBroadcastOnStateChange)
|
||||
verify(currentState.mockBroadcaster).broadcast(any(BroadcastMessage.class), any(NodeAddress.class), eq(null), eq(expectedIsDataOwner));
|
||||
if (expectedBroadcastOnStateChange) {
|
||||
if (protectedStorageEntry instanceof ProtectedMailboxStorageEntry)
|
||||
verify(currentState.mockBroadcaster).broadcast(any(RemoveMailboxDataMessage.class), any(NodeAddress.class), eq(null), eq(expectedIsDataOwner));
|
||||
else
|
||||
verify(currentState.mockBroadcaster).broadcast(any(RemoveDataMessage.class), any(NodeAddress.class), eq(null), eq(expectedIsDataOwner));
|
||||
}
|
||||
|
||||
} else {
|
||||
Assert.assertEquals(beforeState.protectedStorageEntryBeforeOp, currentState.mockedStorage.getMap().get(hashMapHash));
|
||||
|
|
Loading…
Add table
Reference in a new issue