package org.gbif.checklistbank.cli.nubbuild;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.google.common.io.Resources;
import org.gbif.checklistbank.cli.importer.ImporterConfiguration;
import org.junit.Test;

import static org.junit.Assert.*;

public class NubConfigurationTest {

    final ObjectMapper CFG_MAPPER = new ObjectMapper(new YAMLFactory());

    @Test
    public void testConfigs() throws Exception {
        NubConfiguration cfg = CFG_MAPPER.readValue(Resources.getResource("nub-test-cfg.yaml"), NubConfiguration.class);
        cfg.normalizeConfigs();

        assertEquals(4, cfg.blacklist.size());
        assertEquals(129, cfg.homonymExclusions.size());

        assertTrue(cfg.isBlacklisted("Incertae"));
        assertTrue(cfg.isBlacklisted("Calendrella cinerea ongumaensis"));
        assertFalse(cfg.isBlacklisted("Calendrella cinerea"));

        assertTrue(cfg.isExcludedHomonym("Glossoscolecidae", "Crassiclitellata"));
    }
}
@@ -271,20 +271,67 @@
 g.junit.
-Test
+Ignore;%0Aimport org.junit.Test;%0A%0Aimport java.io.File
 ;%0A%0Aimpor
@@ -1066,10 +1066,341 @@
 );%0A    %7D
+%0A%0A    @Test%0A    @Ignore(%22manual local test to make sure config file is readable%22)%0A    public void testNubConfig() throws Exception %7B%0A        NubConfiguration cfg = CFG_MAPPER.readValue(new File(%22/Users/markus/code/gbif/gbif-configuration/cli/nub/config/clb-nub.yaml%22), NubConfiguration.class);%0A        cfg.normalizeConfigs();%0A    %7D
 %0A%7D

Add manual local nub config test