@Test void watchPredefinedFolder() { LanguageClient client = mock(LanguageClient.class); ClientProvider provider = new ClientProvider(); provider.set(client); ArgumentCaptor<RegistrationParams> captor = forClass(RegistrationParams.class); WatcherService watcherService = new WatcherServiceImpl(provider); watcherService.watchPredefinedFolder(); verify(client).registerCapability(captor.capture()); assertRegistrationParams(captor.getValue()); }
@Override public void watchPredefinedFolder() { register( singletonList( new Registration( PREDEFINED_FOLDER_WATCHER, WATCH_FILES, new DidChangeWatchedFilesRegistrationOptions( singletonList(new FileSystemWatcher(COPYBOOKS_FOLDER_GLOB, WATCH_ALL_KIND)))))); }
WatcherServiceImpl implements WatcherService { @Override public void watchPredefinedFolder() { register( singletonList( new Registration( PREDEFINED_FOLDER_WATCHER, WATCH_FILES, new DidChangeWatchedFilesRegistrationOptions( singletonList(new FileSystemWatcher(COPYBOOKS_FOLDER_GLOB, WATCH_ALL_KIND)))))); } }
WatcherServiceImpl implements WatcherService { @Override public void watchPredefinedFolder() { register( singletonList( new Registration( PREDEFINED_FOLDER_WATCHER, WATCH_FILES, new DidChangeWatchedFilesRegistrationOptions( singletonList(new FileSystemWatcher(COPYBOOKS_FOLDER_GLOB, WATCH_ALL_KIND)))))); } @Inject  WatcherServiceImpl(Provider<LanguageClient> clientProvider); }
WatcherServiceImpl implements WatcherService { @Override public void watchPredefinedFolder() { register( singletonList( new Registration( PREDEFINED_FOLDER_WATCHER, WATCH_FILES, new DidChangeWatchedFilesRegistrationOptions( singletonList(new FileSystemWatcher(COPYBOOKS_FOLDER_GLOB, WATCH_ALL_KIND)))))); } @Inject  WatcherServiceImpl(Provider<LanguageClient> clientProvider); @Nonnull List<String> getWatchingFolders(); @Override void watchConfigurationChange(); @Override void watchPredefinedFolder(); @Override @Synchronized void addWatchers(@Nonnull List<String> paths); @Override @Synchronized void removeWatchers(@Nonnull List<String> paths); }
WatcherServiceImpl implements WatcherService { @Override public void watchPredefinedFolder() { register( singletonList( new Registration( PREDEFINED_FOLDER_WATCHER, WATCH_FILES, new DidChangeWatchedFilesRegistrationOptions( singletonList(new FileSystemWatcher(COPYBOOKS_FOLDER_GLOB, WATCH_ALL_KIND)))))); } @Inject  WatcherServiceImpl(Provider<LanguageClient> clientProvider); @Nonnull List<String> getWatchingFolders(); @Override void watchConfigurationChange(); @Override void watchPredefinedFolder(); @Override @Synchronized void addWatchers(@Nonnull List<String> paths); @Override @Synchronized void removeWatchers(@Nonnull List<String> paths);  }