Ignore:
Timestamp:
2023-03-21T14:49:10+01:00 (18 months ago)
Author:
taylor.smock
Message:

See #16567: Convert most plugin tests to JUnit 5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/http2/test/unit/org/openstreetmap/josm/plugins/http2/Http2ClientTest.java

    r35790 r36064  
    22package org.openstreetmap.josm.plugins.http2;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
     5import static org.junit.jupiter.api.Assertions.assertEquals;
    56import static org.junit.jupiter.api.Assertions.assertThrows;
    67import static org.junit.jupiter.api.Assertions.assertTrue;
     
    6364
    6465    @Test
    65     void testCreateRequest_invalidURI() throws Exception {
     66    void testCreateRequestInvalidURI() {
    6667        // From https://josm.openstreetmap.de/ticket/21126
    6768        // URISyntaxException for URL not formatted strictly according to RFC2396
    6869        // See chapter "2.4.3. Excluded US-ASCII Characters"
    69         assertTrue(assertThrows(IOException.class, () -> new Http2Client(
    70                 new URL("https://commons.wikimedia.org/w/api.php?format=xml&action=query&list=geosearch&gsnamespace=6&gslimit=500&gsprop=type|name&gsbbox=52.2804692|38.1772755|52.269721|38.2045051"), "GET")
     70        final URL url = assertDoesNotThrow(() -> new URL("https://commons.wikimedia.org/w/api.php?format=xml&action=query&list=geosearch&gsnamespace=6&gslimit=500&gsprop=type|name&gsbbox=52.2804692|38.1772755|52.269721|38.2045051"));
     71        assertTrue(assertThrows(IOException.class, () -> new Http2Client(url, "GET")
    7172                .createRequest()).getCause().getMessage().startsWith("Illegal character in query at index 116:"));
    7273    }
Note: See TracChangeset for help on using the changeset viewer.