Changeset 9756 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-02-08T00:25:12+01:00 (4 years ago)
Author:
bastiK
Message:

fix test (see #12437)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/ImageryInfoTest.java

    r9713 r9756  
    66import java.util.Arrays;
    77import java.util.Collections;
    8 import java.util.List;
     8import java.util.HashSet;
    99import java.util.Map;
     10import java.util.Set;
    1011
    1112import org.junit.BeforeClass;
     
    1314import org.openstreetmap.josm.JOSMFixture;
    1415import org.openstreetmap.josm.data.Preferences;
     16import org.openstreetmap.josm.tools.MultiMap;
    1517
    1618/**
     
    4648    public void testSerializeStruct() {
    4749        final ImageryInfo.ImageryPreferenceEntry info = new ImageryInfo.ImageryPreferenceEntry();
    48         info.noTileHeaders = Collections.singletonMap("ETag", Arrays.asList("foo", "bar"));
     50        info.noTileHeaders = new MultiMap<>();
     51        info.noTileHeaders.put("ETag", "foo");
     52        info.noTileHeaders.put("ETag", "bar");
    4953        final Map<String, String> map = Preferences.serializeStruct(info, ImageryInfo.ImageryPreferenceEntry.class);
    5054        assertEquals("{noTileHeaders={\"ETag\":[\"foo\",\"bar\"]}}", map.toString());
     
    5862        final ImageryInfo.ImageryPreferenceEntry info = Preferences.deserializeStruct(
    5963                Collections.singletonMap("noTileHeaders", "{\"ETag\":[\"foo\",\"bar\"]}"), ImageryInfo.ImageryPreferenceEntry.class);
    60         assertEquals(info.noTileHeaders, Collections.singletonMap("ETag", Arrays.asList("foo", "bar")));
    61         final List<String> eTag = info.noTileHeaders.get("ETag");
    62         assertEquals(eTag, Arrays.asList("foo", "bar"));
     64        MultiMap<String, String> expect = new MultiMap<>();
     65        expect.put("ETag", "foo");
     66        expect.put("ETag", "bar");
     67        assertEquals(info.noTileHeaders, expect);
     68        final Set<String> eTag = info.noTileHeaders.get("ETag");
     69        assertEquals(eTag, new HashSet<String>(Arrays.asList("foo", "bar")));
    6370    }
    6471
     
    7077        final ImageryInfo.ImageryPreferenceEntry info = Preferences.deserializeStruct(
    7178                Collections.singletonMap("noTileHeaders", "{\"ETag\":\"foo-and-bar\"}"), ImageryInfo.ImageryPreferenceEntry.class);
    72         final List<String> eTag = info.noTileHeaders.get("ETag");
    73         assertEquals(eTag, Arrays.asList("foo", "bar"));
     79        final Set<String> eTag = info.noTileHeaders.get("ETag");
     80        assertEquals(eTag, Collections.singleton("foo-and-bar"));
    7481    }
    7582}
Note: See TracChangeset for help on using the changeset viewer.