@@ -0,0 +1,2349 @@
+package fi.nls.oskari.map.data.domain;%0A%0Aimport fi.nls.oskari.domain.map.OskariLayer;%0Aimport fi.nls.oskari.util.IOHelper;%0Aimport fi.nls.oskari.util.JSONHelper;%0Aimport org.json.JSONArray;%0Aimport org.json.JSONObject;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.util.Arrays;%0A%0Aimport static fi.nls.oskari.service.capabilities.CapabilitiesConstants.*;%0A%0Apublic class GFIRequestParamsTest %7B%0A    private static final String JSON = %22application/json%22;%0A    private static final String TEXT = %22text/plain%22;%0A    private static final String HTML = %22text/html%22;%0A%0A    private GFIRequestParams getParams () %7B%0A        GFIRequestParams params = new GFIRequestParams();%0A        OskariLayer layer = new OskariLayer();%0A        layer.setName(%22test%22);%0A        layer.setUrl(%22https://example.com/%22);%0A        params.setLayer(layer);%0A        return params;%0A    %7D%0A    private void setCapabilities (GFIRequestParams params, boolean setValue) %7B%0A        JSONObject capa = new JSONObject();%0A        JSONObject formats = new JSONObject();%0A        if (setValue) %7B%0A            JSONHelper.putValue(formats, KEY_VALUE, JSON);%0A        %7D%0A        JSONHelper.put(formats, KEY_AVAILABLE, new JSONArray(Arrays.asList(JSON, TEXT)));%0A        JSONHelper.putValue(capa, KEY_FORMATS, formats);%0A        params.getLayer().setCapabilities(capa);%0A    %7D%0A    private String parseInfoFormat(String url) %7B%0A        return IOHelper.parseQuerystring(url).get(%22INFO_FORMAT%22).get(0);%0A    %7D%0A    @Test%0A    public void testDefault() %7B%0A        String format = parseInfoFormat(getParams().getGFIUrl());%0A        Assert.assertEquals(HTML, format);%0A    %7D%0A    @Test%0A    public void testGFIType() %7B%0A        GFIRequestParams params = getParams();%0A        params.getLayer().setGfiType(JSON);%0A        String format = parseInfoFormat(params.getGFIUrl());%0A        Assert.assertEquals(JSON, format);%0A    %7D%0A    @Test%0A    public void testCapabilitiesValue() %7B%0A        GFIRequestParams params = getParams();%0A        setCapabilities(params, true);%0A        String format = parseInfoFormat(params.getGFIUrl());%0A        Assert.assertEquals(JSON, format);%0A    %7D%0A    @Test%0A    public void testCapabilitiesAvailable() %7B%0A        GFIRequestParams params = getParams();%0A        setCapabilities(params, false);%0A        String format = parseInfoFormat(params.getGFIUrl());%0A        Assert.assertEquals(TEXT, format);%0A%0A    %7D%0A%7D%0A

add test for gfi type