FileWatcherConnector extends VirtualConnector implements EventSupport { @Override public void onEvent(Event event) { try { update(); } catch (IOException e) { throw new RuntimeException(e); } } FileWatcherConnector(String instanceId, String domainType, PersistInterface persistService,
            QueryInterface queryService, AuthenticationContext authenticationContext); @Override void onEvent(Event event); void setFileSerializer(FileSerializer<?> fileSerializer); void setLocalModels(List<?> localModels); void setModelType(Class<?> modelType); void setWatchfile(File watchfile);  }
@Test public void datachangedEvent_shouldTriggerUpdate() throws Exception { File testconnectorFolder = new File(tmpFolder.getRoot(), "testconnector"); File testFile = new File(testconnectorFolder, "testfile"); ConnectorDescription desc = makeConnectorDescription(CSVParser.class, testFile); connectorManager.create(desc); ServiceReference<EventSupport> reference = bundleContext.getServiceReference(EventSupport.class); EventSupport service = bundleContext.getService(reference); service.onEvent(new Event()); verify(queryService).queryForActiveModels(TestModel.class); }