We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bf6044 commit ba7fb76Copy full SHA for ba7fb76
platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java
@@ -33,12 +33,15 @@
33
class CompositeLockTests {
34
35
@Test
36
- void acquiresAllLocks() throws Exception {
37
- ReentrantLock lock1 = new ReentrantLock();
38
- ReentrantLock lock2 = new ReentrantLock();
+ void acquiresAllLocksInOrder() throws Exception {
+ ReentrantLock lock1 = spy(new ReentrantLock());
+ ReentrantLock lock2 = spy(new ReentrantLock());
39
40
new CompositeLock(asList(lock1, lock2)).acquire();
41
42
+ InOrder inOrder = inOrder(lock1, lock2);
43
+ inOrder.verify(lock1).lockInterruptibly();
44
+ inOrder.verify(lock2).lockInterruptibly();
45
assertTrue(lock1.isLocked());
46
assertTrue(lock2.isLocked());
47
}
0 commit comments