### Question:
GoLanguage extends AbstractLanguage { @Override public String[] getFileSuffixes() { String[] suffixes = configuration.getStringArray(FILE_SUFFIXES_KEY); if (suffixes == null || suffixes.length == 0) { suffixes = new String[] {FILE_SUFFIXES_DEFAULT_VALUE}; } return suffixes; } GoLanguage(Configuration configuration); @Override String[] getFileSuffixes(); static final String KEY; static final String FILE_SUFFIXES_KEY; static final String FILE_SUFFIXES_DEFAULT_VALUE; }### Answer:
@Test void should_have_correct_file_extensions() { MapSettings mapSettings = new MapSettings(); GoLanguage typeScriptLanguage = new GoLanguage(mapSettings.asConfig()); assertThat(typeScriptLanguage.getFileSuffixes()).containsExactly(".go"); }
@Test void can_override_file_extensions() { MapSettings mapSettings = new MapSettings(); mapSettings.setProperty("sonar.go.file.suffixes", ".go1,.go2"); GoLanguage typeScriptLanguage = new GoLanguage(mapSettings.asConfig()); assertThat(typeScriptLanguage.getFileSuffixes()).containsExactly(".go1",".go2"); }