1
2
3
4
5
6 package integration.tests.other.control.structures;
7
8 import org.junit.jupiter.api.Assertions;
9 import org.junit.jupiter.api.Test;
10
11 class SynchronizedBlocksTest {
12 private final SynchronizedBlocks tested = new SynchronizedBlocks();
13
14 @Test
15 void doInSynchronizedBlock() {
16 tested.doInSynchronizedBlock();
17 }
18
19 @Test
20 void doInSynchronizedBlockWithTrue() {
21 tested.doInSynchronizedBlockWithParameter(true);
22 }
23
24 @Test
25 void doInSynchronizedBlockWithFalse() {
26 Assertions.assertThrows(RuntimeException.class, () -> {
27 tested.doInSynchronizedBlockWithParameter(false);
28 });
29 }
30 }