Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (3 years ago)
Author:
Don-vip
Message:

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/data/BoundariesTestIT.java

    r13412 r17275  
    22package org.openstreetmap.josm.data;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.io.InputStream;
     
    1111import java.util.stream.Collectors;
    1212
    13 import org.junit.Rule;
    14 import org.junit.Test;
     13import org.junit.jupiter.api.Test;
     14import org.junit.jupiter.api.extension.RegisterExtension;
    1515import org.openstreetmap.josm.data.osm.DataSet;
    1616import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    2424 * Test of boundaries OSM file.
    2525 */
    26 public class BoundariesTestIT {
     26class BoundariesTestIT {
    2727
    2828    private static final List<String> RETIRED_ISO3166_1_CODES = Arrays.asList(
     
    5050     * Setup test.
    5151     */
    52     @Rule
     52    @RegisterExtension
    5353    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    5454    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    5959     */
    6060    @Test
    61     public void testBoundariesFile() throws Exception {
     61    void testBoundariesFile() throws Exception {
    6262        try (InputStream is = getClass().getResourceAsStream("/data/boundaries.osm")) {
    6363            DataSet ds = OsmReader.parseDataSet(is, null);
     
    6767            for (String code : iso31661a2) {
    6868                if (!RETIRED_ISO3166_1_CODES.contains(code)) {
    69                     assertEquals(code, 1, tagged.stream().filter(SearchCompiler.compile("ISO3166-1\\:alpha2="+code)).count());
     69                    assertEquals(1, tagged.stream().filter(SearchCompiler.compile("ISO3166-1\\:alpha2="+code)).count(), code);
    7070                }
    7171            }
     
    7373            for (OsmPrimitive p : tagged.stream().filter(SearchCompiler.compile("ISO3166-1\\:alpha2")).collect(Collectors.toList())) {
    7474                String code = p.get("ISO3166-1:alpha2");
    75                 assertTrue(code, iso31661a2.contains(code) || EXCEPTIONNALY_RESERVED_ISO3166_1_CODES.contains(code));
     75                assertTrue(iso31661a2.contains(code) || EXCEPTIONNALY_RESERVED_ISO3166_1_CODES.contains(code), code);
    7676            }
    7777            // Check presence of all ISO-3166-2 codes for USA, Canada, Australia (for speed limits)
    7878            for (String code : ISO3166_2_CODES) {
    79                 assertEquals(code, 1, tagged.stream().filter(SearchCompiler.compile("ISO3166-2="+code)).count());
     79                assertEquals(1, tagged.stream().filter(SearchCompiler.compile("ISO3166-2="+code)).count(), code);
    8080            }
    8181        }
Note: See TracChangeset for help on using the changeset viewer.