@@ -0,0 +1,2235 @@
+package flyway.oskari;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.nio.charset.StandardCharsets;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0Aimport org.json.JSONObject;%0Aimport org.junit.Test;%0A%0Aimport fi.nls.oskari.util.IOHelper;%0A%0Apublic class V1_46_10__replace_externalids_in_mapful_layerselection_plugin_config_test %7B%0A%0A    private static final String RESOURCE_FILE_NAME = %22mapfull_sample_config_layer_selection_plugin.json%22;%0A%0A    @Test%0A    public void testUpdateConfig() throws JSONException, IOException %7B%0A        JSONObject config = new JSONObject(getConfig());%0A        JSONArray plugins = config.getJSONArray(%22plugins%22);%0A        JSONObject plugin = V1_46_10__replace_externalids_in_mapful_layerselection_plugin_config.findPlugin(plugins);%0A        JSONObject pluginConfig = plugin.getJSONObject(%22config%22);%0A%0A        String defaultBaseLayer = pluginConfig.getString(%22defaultBaseLayer%22);%0A        assertEquals(%22base_35%22, defaultBaseLayer);%0A%0A        JSONArray baseLayers = pluginConfig.getJSONArray(%22baseLayers%22);%0A        assertEquals(2, baseLayers.length());%0A        assertEquals(%22base_35%22, baseLayers.getString(0));%0A        assertEquals(%2224%22, baseLayers.getString(1));%0A%0A        Map%3CString, Integer%3E externalIdToLayerId = new HashMap%3C%3E();%0A        externalIdToLayerId.put(%22base_35%22, 1337);%0A%0A        boolean updated = V1_46_10__replace_externalids_in_mapful_layerselection_plugin_config.updateConfig(config, externalIdToLayerId);%0A%0A        assertEquals(true, updated);%0A%0A        defaultBaseLayer = pluginConfig.getString(%22defaultBaseLayer%22);%0A        assertEquals(%221337%22, defaultBaseLayer);%0A%0A        assertEquals(2, baseLayers.length());%0A        assertEquals(%221337%22, baseLayers.getString(0));%0A        assertEquals(%2224%22, baseLayers.getString(1));%0A    %7D%0A%0A    private String getConfig() throws IOException %7B%0A        try (InputStream in = V1_46_10__replace_externalids_in_mapful_layerselection_plugin_config_test.class%0A                .getClassLoader()%0A                .getResourceAsStream(RESOURCE_FILE_NAME)) %7B%0A            return new String(IOHelper.readBytes(in), StandardCharsets.UTF_8);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add unit tests