mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
CORDA-2366 - Adjust assertions to cater for any ordering of results. (#4455)
This commit is contained in:
parent
6f0bc42098
commit
6f9f6fd870
@ -114,8 +114,12 @@ class CordappConstraintsTests {
|
||||
printVault(restartedNode, allStates)
|
||||
|
||||
assertThat(allStates).hasSize(2)
|
||||
assertThat(allStates[0].state.constraint).isInstanceOf(HashAttachmentConstraint::class.java)
|
||||
assertThat(allStates[1].state.constraint).isInstanceOf(SignatureAttachmentConstraint::class.java)
|
||||
// cannot guarantee database results ordering so check for one or the other.
|
||||
assertThat(allStates[0].state.constraint).isInstanceOfAny(HashAttachmentConstraint::class.java, SignatureAttachmentConstraint::class.java)
|
||||
if (allStates[0].state.constraint is HashAttachmentConstraint)
|
||||
assertThat(allStates[1].state.constraint).isInstanceOf(SignatureAttachmentConstraint::class.java)
|
||||
else
|
||||
assertThat(allStates[1].state.constraint).isInstanceOf(HashAttachmentConstraint::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user