### Question:
FsExporterDescription extends WindGateExporterDescription { @Override public final DriverScript getDriverScript() { String descriptionClass = getClass().getName(); Class<?> modelType = getModelType(); String path = getPath(); Class<? extends DataModelStreamSupport<?>> supportClass = getStreamSupport(); FsDescriptionUtil.checkCommonConfig(descriptionClass, modelType, supportClass, path); Map<String, String> configuration = new HashMap<>(); configuration.put(FileProcess.FILE.key(), path); configuration.put(StreamProcess.STREAM_SUPPORT.key(), supportClass.getName()); Set<String> parameters = VariableTable.collectVariableNames(path); return new DriverScript(Constants.LOCAL_FILE_RESOURCE_NAME, configuration, parameters); }  abstract String getPath(); abstract Class<? extends DataModelStreamSupport<?>> getStreamSupport(); @Override final DriverScript getDriverScript();  }### Answer:
@Test public void simple() { Mock desc = new Mock("example", StringSupport.class); DriverScript script = desc.getDriverScript(); assertThat(script.getResourceName(), is(Constants.LOCAL_FILE_RESOURCE_NAME)); assertThat(script.getConfiguration(), hasEntry(FileProcess.FILE.key(), "example")); assertThat(script.getConfiguration(), hasEntry(StreamProcess.STREAM_SUPPORT.key(), StringSupport.class.getName())); assertThat(script.getParameterNames(), hasSize(0)); }
@Test public void parameters() { Mock desc = new Mock("testing/${var}", StringSupport.class); DriverScript script = desc.getDriverScript(); assertThat(script.getResourceName(), is(Constants.LOCAL_FILE_RESOURCE_NAME)); assertThat(script.getConfiguration(), hasEntry(FileProcess.FILE.key(), "testing/${var}")); assertThat(script.getConfiguration(), hasEntry(StreamProcess.STREAM_SUPPORT.key(), StringSupport.class.getName())); assertThat(script.getParameterNames(), containsInAnyOrder("var")); }
@Test(expected = IllegalStateException.class) public void invalid_path_null() { Mock desc = new Mock(null, StringSupport.class); desc.getDriverScript(); }
@Test(expected = IllegalStateException.class) public void invalid_path_empty() { Mock desc = new Mock("", StringSupport.class); desc.getDriverScript(); }
@Test(expected = IllegalStateException.class) public void invalid_support_null() { Mock desc = new Mock("example", null); desc.getDriverScript(); }
@Test(expected = IllegalStateException.class) public void invalid_support_inconsistent() { Mock desc = new Mock("example", VoidSupport.class); desc.getDriverScript(); }
@Test(expected = IllegalStateException.class) public void invalid_support_fail() { Mock desc = new Mock("example", InvalidSupport.class); desc.getDriverScript(); }