use of com.hotels.styx.proxy.backends.file.FileChangeMonitor.FileMonitorSettings in project styx by ExpediaGroup.
the class FileBackedBackendServicesRegistryFactoryTest method createsWithFileChangeMonitor.
@Test
public void createsWithFileChangeMonitor() {
Configuration configuration = mockConfiguration(Optional.of(monitoredFile.toString()), Optional.of(new FileMonitorSettings(true)));
FileBackedBackendServicesRegistry registry = (FileBackedBackendServicesRegistry) new FileBackedBackendServicesRegistry.Factory().create(environment, configuration);
assertThat(registry.monitor(), instanceOf(FileChangeMonitor.class));
}
use of com.hotels.styx.proxy.backends.file.FileChangeMonitor.FileMonitorSettings in project styx by ExpediaGroup.
the class FileBackedBackendServicesRegistryFactoryTest method mockConfiguration.
private Configuration mockConfiguration(Optional<String> path, Optional<FileMonitorSettings> monitorSettings) {
Configuration configuration = mock(Configuration.class);
when(configuration.get(eq("originsFile"), eq(String.class))).thenReturn(path);
when(configuration.get(eq("monitor"), eq(FileMonitorSettings.class))).thenReturn(monitorSettings);
return configuration;
}
Aggregations