Changeset 36064 in osm for applications/editors/josm/plugins/http2/test
- Timestamp:
- 2023-03-21T14:49:10+01:00 (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/http2/test/unit/org/openstreetmap/josm/plugins/http2/Http2ClientTest.java
r35790 r36064 2 2 package org.openstreetmap.josm.plugins.http2; 3 3 4 import static org.junit.Assert.assertEquals; 4 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 5 import static org.junit.jupiter.api.Assertions.assertEquals; 5 6 import static org.junit.jupiter.api.Assertions.assertThrows; 6 7 import static org.junit.jupiter.api.Assertions.assertTrue; … … 63 64 64 65 @Test 65 void testCreateRequest _invalidURI() throws Exception{66 void testCreateRequestInvalidURI() { 66 67 // From https://josm.openstreetmap.de/ticket/21126 67 68 // URISyntaxException for URL not formatted strictly according to RFC2396 68 69 // 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") 71 72 .createRequest()).getCause().getMessage().startsWith("Illegal character in query at index 116:")); 72 73 }
Note:
See TracChangeset
for help on using the changeset viewer.