@@ -0,0 +1,1682 @@
+package com.exxeta.iss.sonar.esql;%0A%0Aimport org.junit.Test;%0Aimport org.sonar.api.batch.fs.internal.DefaultInputFile;%0Aimport org.sonar.api.batch.fs.internal.TestInputFileBuilder;%0Aimport org.sonar.api.config.internal.MapSettings;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0A%0Apublic class EsqlExclusionsFileFilterTest %7B%0A   %0A%0A    @Test%0A    public void should_exclude_using_custom_path_regex() throws Exception %7B%0A        MapSettings settings = new MapSettings();%0A        settings.setProperty(%0A                EsqlPlugin.ESQL_EXCLUSIONS_KEY, EsqlPlugin.ESQL_EXCLUSIONS_DEFAULT_VALUE + %22,%22 + %22**/libs/**%22);%0A%0A        EsqlExclusionsFileFilter filter = new EsqlExclusionsFileFilter(settings.asConfig());%0A%0A        assertThat(filter.accept(inputFile(%22some_app.esql%22))).isTrue();%0A        assertThat(filter.accept(inputFile(%22libs/some_lib.esql%22))).isFalse();%0A    %7D%0A%0A    @Test%0A    public void should_ignore_empty_path_regex() throws Exception %7B%0A        MapSettings settings = new MapSettings();%0A        settings.setProperty(EsqlPlugin.ESQL_EXCLUSIONS_KEY, %22,%22 + EsqlPlugin.ESQL_EXCLUSIONS_DEFAULT_VALUE + %22,%22);%0A%0A        EsqlExclusionsFileFilter filter = new EsqlExclusionsFileFilter(settings.asConfig());%0A%0A        assertThat(filter.accept(inputFile(%22some_app.esql%22))).isTrue();%0A    %7D%0A%0A    private DefaultInputFile inputFile(String file) %7B%0A        return new TestInputFileBuilder(%22test%22,%22test_node_modules/%22 + file)%0A                .setLanguage(language(file))%0A                .setContents(%22foo();%22)%0A                .build();%0A    %7D%0A%0A    private static String language(String filename) %7B%0A        String%5B%5D parts = filename.split(%22%5C%5C.%22);%0A        return parts%5Bparts.length - 1%5D;%0A    %7D%0A%7D%0A

Add test