assertFalse(trackerRepository.allTrackers(process.tenantId()).isEmpty());
assertTrue(trackerRepository.allTimedOutOf(process.tenantId()).isEmpty());
}
public void testTimedOutProcess() throws Exception {
TestableTimeConstrainedProcess process1 = new TestableTimeConstrainedProcess(
TENANT_ID,
ProcessId.newProcessId(),
"Testable Time Constrained Process 1",
1L); // forced timeout
TimeConstrainedProcessTracker tracker1 =
process1.timeConstrainedProcessTracker();
TestableTimeConstrainedProcess process2 =
new TestableTimeConstrainedProcess(
TENANT_ID,
ProcessId.newProcessId(),
"Testable Time Constrained Process 2",
5000L);
TimeConstrainedProcessTracker tracker2 =
process2.timeConstrainedProcessTracker();
LevelDBUnitOfWork.start(this.database);
trackerRepository.save(tracker1);
trackerRepository.save(tracker2);
LevelDBUnitOfWork.current().commit();