mirror of
https://github.com/corda/corda.git
synced 2025-01-30 08:04:16 +00:00
Minor: Unit testing: don't always require a lambda when running the network synchronously.
This commit is contained in:
parent
40d9b7686b
commit
f92455442d
@ -48,9 +48,13 @@ open class TestWithInMemoryNetwork {
|
||||
// Keep calling "pump" in rounds until every node in the network reports that it had nothing to do
|
||||
fun <T> runNetwork(body: () -> T): T {
|
||||
val result = body()
|
||||
while (pumpAll(false).any { it }) {}
|
||||
runNetwork()
|
||||
return result
|
||||
}
|
||||
|
||||
fun runNetwork() {
|
||||
while (pumpAll(false).any { it }) {}
|
||||
}
|
||||
}
|
||||
|
||||
class InMemoryMessagingTests : TestWithInMemoryNetwork() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user