@Test void watchConfigurationChange() { LanguageClient client = mock(LanguageClient.class); ClientProvider provider = new ClientProvider(); provider.set(client); ArgumentCaptor<RegistrationParams> captor = forClass(RegistrationParams.class); WatcherService watcherService = new WatcherServiceImpl(provider); watcherService.watchConfigurationChange(); verify(client).registerCapability(captor.capture()); RegistrationParams params = captor.getValue(); assertEquals(1, params.getRegistrations().size()); Registration registration = params.getRegistrations().get(0); assertNotNull(registration.getId()); assertEquals("workspace/didChangeConfiguration", registration.getMethod()); assertNull(registration.getRegisterOptions()); }
@Override public void watchConfigurationChange() { register(singletonList(new Registration(CONFIGURATION_CHANGE_ID, WATCH_CONFIGURATION, null))); }
WatcherServiceImpl implements WatcherService { @Override public void watchConfigurationChange() { register(singletonList(new Registration(CONFIGURATION_CHANGE_ID, WATCH_CONFIGURATION, null))); } }
WatcherServiceImpl implements WatcherService { @Override public void watchConfigurationChange() { register(singletonList(new Registration(CONFIGURATION_CHANGE_ID, WATCH_CONFIGURATION, null))); } @Inject  WatcherServiceImpl(Provider<LanguageClient> clientProvider); }
WatcherServiceImpl implements WatcherService { @Override public void watchConfigurationChange() { register(singletonList(new Registration(CONFIGURATION_CHANGE_ID, WATCH_CONFIGURATION, null))); } @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 watchConfigurationChange() { register(singletonList(new Registration(CONFIGURATION_CHANGE_ID, WATCH_CONFIGURATION, null))); } @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);  }