@@ -77,7 +77,7 @@ void newDirectoryWithFilesChangesDetected() throws IOException {
7777 var target = new AtomicReference <Path >();
7878 var created = new AtomicBoolean (false );
7979 var changed = new AtomicBoolean (false );
80- var watchConfig = Watcher .watch (testDir .getTestDirectory (), WatchScope .PATH_AND_ALL_DESCENDANTS )
80+ var watchConfig = Watcher .build (testDir .getTestDirectory (), WatchScope .PATH_AND_ALL_DESCENDANTS )
8181 .on (ev -> {
8282 logger .debug ("Event received: {}" , ev );
8383 if (ev .calculateFullPath ().equals (target .get ())) {
@@ -109,7 +109,7 @@ void newDirectoryWithFilesChangesDetected() throws IOException {
109109 void correctRelativePathIsReported () throws IOException {
110110 Path relative = Path .of ("a" ,"b" , "c" , "d.txt" );
111111 var seen = new AtomicBoolean (false );
112- var watcher = Watcher .watch (testDir .getTestDirectory (), WatchScope .PATH_AND_ALL_DESCENDANTS )
112+ var watcher = Watcher .build (testDir .getTestDirectory (), WatchScope .PATH_AND_ALL_DESCENDANTS )
113113 .on (ev -> {
114114 logger .debug ("Seen event: {}" , ev );
115115 if (ev .getRelativePath ().equals (relative )) {
@@ -134,7 +134,7 @@ void deleteOfFileInDirectoryShouldBeVisible() throws IOException {
134134 .findAny ()
135135 .orElseThrow ();
136136 var seen = new AtomicBoolean (false );
137- var watchConfig = Watcher .watch (target .getParent (), WatchScope .PATH_AND_CHILDREN )
137+ var watchConfig = Watcher .build (target .getParent (), WatchScope .PATH_AND_CHILDREN )
138138 .on (ev -> {
139139 if (ev .getKind () == Kind .DELETED && ev .calculateFullPath ().equals (target )) {
140140 seen .set (true );
@@ -160,7 +160,7 @@ void overflowsAreRecoveredFrom(Approximation whichFiles) throws IOException, Int
160160 // Configure and start watch
161161 var dropEvents = new AtomicBoolean (false ); // Toggles overflow simulation
162162 var bookkeeper = new TestHelper .Bookkeeper ();
163- var watchConfig = Watcher .watch (parent , WatchScope .PATH_AND_ALL_DESCENDANTS )
163+ var watchConfig = Watcher .build (parent , WatchScope .PATH_AND_ALL_DESCENDANTS )
164164 .withExecutor (ForkJoinPool .commonPool ())
165165 .filter (e -> !dropEvents .get ())
166166 .onOverflow (whichFiles )
0 commit comments