use of org.apache.commons.vfs2.FileChangeEvent in project motech by motech.
the class ConfigFileMonitorTest method shouldSaveConfigWhenNewFileCreated.
@Test
public void shouldSaveConfigWhenNewFileCreated() throws IOException {
final String fileName = "res:config/org.motechproject.motech-module1/somemodule.properties";
FileObject fileObject = VFS.getManager().resolveFile(fileName);
configFileMonitor.fileCreated(new FileChangeEvent(fileObject));
verify(configurationService).addOrUpdate(new File(fileObject.getName().getPath()));
}
use of org.apache.commons.vfs2.FileChangeEvent in project motech by motech.
the class ConfigFileMonitorTest method shouldNotSaveConfigWhenNewFileCreatedIsNotSupported.
@Test
public void shouldNotSaveConfigWhenNewFileCreatedIsNotSupported() throws IOException {
final String fileName = "res:config/motech-settings.conf";
FileObject fileObject = VFS.getManager().resolveFile(fileName);
configFileMonitor.fileCreated(new FileChangeEvent(fileObject));
verifyZeroInteractions(configurationService);
}
Aggregations