From 0cd57c81bcf64cc74e1ed7201332ce7bc437117f Mon Sep 17 00:00:00 2001 From: Christian Sailer Date: Fri, 21 Jun 2019 15:16:10 +0100 Subject: [PATCH] Test the scheduler picking up a persisted scheduled state without shutting down/restart the db. (#5236) --- .../node/services/events/NodeSchedulerServiceTest.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt index b0279be977..e5209f72ec 100644 --- a/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt @@ -312,15 +312,13 @@ class NodeSchedulerPersistenceTest : NodeSchedulerServiceTestBase() { // Force the thread to shut down with operations waiting scheduler.cancelAndWait() - } - val flowLogic = rigorousMock>() - val logicRef = rigorousMock() + val flowLogic = rigorousMock>() + val logicRef = rigorousMock() - transactionStates[stateRef] = transactionStateMock(logicRef, timeInTheFuture) - flows[logicRef] = flowLogic + transactionStates[stateRef] = transactionStateMock(logicRef, timeInTheFuture) + flows[logicRef] = flowLogic - configureDatabase(dataSourceProps, DatabaseConfig(), { null }, { null }).use { database -> val newScheduler = database.transaction { createScheduler(database) } @@ -328,6 +326,7 @@ class NodeSchedulerPersistenceTest : NodeSchedulerServiceTestBase() { assertStarted(flowLogic) newScheduler.close() + } }