mirror of
https://github.com/corda/corda.git
synced 2025-02-06 19:19:19 +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
|
// Keep calling "pump" in rounds until every node in the network reports that it had nothing to do
|
||||||
fun <T> runNetwork(body: () -> T): T {
|
fun <T> runNetwork(body: () -> T): T {
|
||||||
val result = body()
|
val result = body()
|
||||||
while (pumpAll(false).any { it }) {}
|
runNetwork()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun runNetwork() {
|
||||||
|
while (pumpAll(false).any { it }) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class InMemoryMessagingTests : TestWithInMemoryNetwork() {
|
class InMemoryMessagingTests : TestWithInMemoryNetwork() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user