Skip to content

Commit 7c8482f

Browse files
committed
Fix some warnings in the test code
1 parent f9904b6 commit 7c8482f

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

src/test/java/engineering/swat/watch/APIErrorsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.junit.jupiter.api.BeforeEach;
3838
import org.junit.jupiter.api.Test;
3939

40-
public class APIErrorsTests {
40+
class APIErrorsTests {
4141

4242
private TestDirectory testDir;
4343

src/test/java/engineering/swat/watch/DeleteLockTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void setup() throws IOException {
5151
}
5252

5353
@AfterEach
54-
void cleanup() throws IOException {
54+
void cleanup() {
5555
if (testDir != null) {
5656
testDir.close();
5757
}

src/test/java/engineering/swat/watch/RecursiveWatchTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import java.io.IOException;
3232
import java.nio.file.Files;
3333
import java.nio.file.Path;
34-
import java.util.concurrent.TimeUnit;
3534
import java.util.concurrent.atomic.AtomicBoolean;
3635
import java.util.concurrent.atomic.AtomicReference;
3736

@@ -56,14 +55,14 @@ void setup() throws IOException {
5655
}
5756

5857
@AfterEach
59-
void cleanup() throws IOException {
58+
void cleanup() {
6059
if (testDir != null) {
6160
testDir.close();
6261
}
6362
}
6463

6564
@BeforeAll
66-
static void setupEverything() throws IOException {
65+
static void setupEverything() {
6766
Awaitility.setDefaultTimeout(TestHelper.NORMAL_WAIT);
6867
}
6968

@@ -123,7 +122,7 @@ void correctRelativePathIsReported() throws IOException {
123122
}
124123

125124
@Test
126-
void deleteOfFileInDirectoryShouldBeVisible() throws IOException, InterruptedException {
125+
void deleteOfFileInDirectoryShouldBeVisible() throws IOException {
127126
var target = testDir.getTestFiles()
128127
.stream()
129128
.filter(p -> !p.getParent().equals(testDir.getTestDirectory()))

src/test/java/engineering/swat/watch/SingleDirectoryTests.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
import java.io.IOException;
3232
import java.nio.file.Files;
33-
import java.time.Duration;
34-
import java.util.concurrent.TimeUnit;
3533
import java.util.concurrent.atomic.AtomicBoolean;
3634

3735
import org.awaitility.Awaitility;
@@ -42,7 +40,7 @@
4240

4341
import engineering.swat.watch.WatchEvent.Kind;
4442

45-
public class SingleDirectoryTests {
43+
class SingleDirectoryTests {
4644
private TestDirectory testDir;
4745

4846
@BeforeEach
@@ -51,7 +49,7 @@ void setup() throws IOException {
5149
}
5250

5351
@AfterEach
54-
void cleanup() throws IOException {
52+
void cleanup() {
5553
if (testDir != null) {
5654
testDir.close();
5755
}
@@ -63,7 +61,7 @@ static void setupEverything() {
6361
}
6462

6563
@Test
66-
void deleteOfFileInDirectoryShouldBeVisible() throws IOException, InterruptedException {
64+
void deleteOfFileInDirectoryShouldBeVisible() throws IOException {
6765
var target = testDir.getTestFiles().get(0);
6866
var seenDelete = new AtomicBoolean(false);
6967
var seenCreate = new AtomicBoolean(false);
@@ -91,7 +89,7 @@ void deleteOfFileInDirectoryShouldBeVisible() throws IOException, InterruptedExc
9189
}
9290

9391
@Test
94-
void alternativeAPITest() throws IOException, InterruptedException {
92+
void alternativeAPITest() throws IOException {
9593
var target = testDir.getTestFiles().get(0);
9694
var seenDelete = new AtomicBoolean(false);
9795
var seenCreate = new AtomicBoolean(false);

src/test/java/engineering/swat/watch/SingleFileTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import org.junit.jupiter.api.BeforeEach;
4141
import org.junit.jupiter.api.Test;
4242

43-
public class SingleFileTests {
43+
class SingleFileTests {
4444
private TestDirectory testDir;
4545

4646
@BeforeEach
@@ -49,7 +49,7 @@ void setup() throws IOException {
4949
}
5050

5151
@AfterEach
52-
void cleanup() throws IOException {
52+
void cleanup() {
5353
if (testDir != null) {
5454
testDir.close();
5555
}

src/test/java/engineering/swat/watch/SmokeTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
import java.io.IOException;
3434
import java.nio.file.Files;
35-
import java.util.concurrent.TimeUnit;
3635
import java.util.concurrent.atomic.AtomicBoolean;
3736

3837
import org.awaitility.Awaitility;
@@ -51,7 +50,7 @@ void setup() throws IOException {
5150
}
5251

5352
@AfterEach
54-
void cleanup() throws IOException {
53+
void cleanup() {
5554
if (testDir != null) {
5655
testDir.close();
5756
}
@@ -63,7 +62,7 @@ static void setupEverything() {
6362
}
6463

6564
@Test
66-
void watchDirectory() throws IOException, InterruptedException {
65+
void watchDirectory() throws IOException {
6766
var changed = new AtomicBoolean(false);
6867
var target = testDir.getTestFiles().get(0);
6968
var watchConfig = Watcher.watch(testDir.getTestDirectory(), WatchScope.PATH_AND_CHILDREN)
@@ -77,7 +76,7 @@ void watchDirectory() throws IOException, InterruptedException {
7776
}
7877

7978
@Test
80-
void watchRecursiveDirectory() throws IOException, InterruptedException {
79+
void watchRecursiveDirectory() throws IOException {
8180
var changed = new AtomicBoolean(false);
8281
var target = testDir.getTestFiles().stream()
8382
.filter(p -> !p.getParent().equals(testDir.getTestDirectory()))

0 commit comments

Comments
 (0)