use of org.neo4j.lock.LockGroup in project neo4j by neo4j.
the class LockGroupTest method shouldReleaseAllLocksWhenExitingTheLockGroupRegion.
@Test
void shouldReleaseAllLocksWhenExitingTheLockGroupRegion() {
// given
Lock lock1 = mock(Lock.class);
Lock lock2 = mock(Lock.class);
Lock lock3 = mock(Lock.class);
// when
try (LockGroup locks = new LockGroup()) {
locks.add(lock1);
locks.add(lock2);
locks.add(lock3);
}
// then
verify(lock1).release();
verify(lock2).release();
verify(lock3).release();
}
Aggregations