EsqlLanguage extends AbstractLanguage { @Override public String[] getFileSuffixes() { return configuration.getStringArray(FILE_SUFFIXES_KEY); } EsqlLanguage(Configuration configuration); @Override String[] getFileSuffixes(); static final String KEY; }
@Test public void defaultSuffixes() { MapSettings mapSettings = new MapSettings(); mapSettings.setProperty(EsqlLanguage.FILE_SUFFIXES_KEY, EsqlLanguage.FILE_SUFFIXES_DEFVALUE); EsqlLanguage esqlLanguage = new EsqlLanguage(mapSettings.asConfig()); assertThat(esqlLanguage.getFileSuffixes()).containsOnly(".esql"); }
@Test public void customSuffixes() { MapSettings mapSettings = new MapSettings(); mapSettings.setProperty(EsqlLanguage.FILE_SUFFIXES_KEY, "esql"); EsqlLanguage esqlLanguage = new EsqlLanguage(mapSettings.asConfig()); assertThat(esqlLanguage.getFileSuffixes()).containsOnly("esql"); }