Changeset 16589 in josm for trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler
- Timestamp:
- 2020-06-09T23:44:55+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java
r16588 r16589 2 2 package org.openstreetmap.josm.io.remotecontrol.handler; 3 3 4 import static org.hamcrest.CoreMatchers.hasItem; 4 5 import static org.junit.Assert.assertEquals; 6 import static org.junit.Assert.assertThat; 7 8 import java.util.Arrays; 9 import java.util.List; 5 10 6 11 import org.junit.Rule; … … 81 86 82 87 /** 88 * Unit test for {@link ImageryHandler#getOptionalParams()} 89 * @throws Exception if any error occurs 90 */ 91 @Test 92 public void testOptionalParams() throws Exception { 93 List<String> optionalParams = Arrays.asList(newHandler("").getOptionalParams()); 94 assertThat(optionalParams, hasItem("type")); 95 assertThat(optionalParams, hasItem("min-zoom")); 96 assertThat(optionalParams, hasItem("max-zoom")); 97 assertThat(optionalParams, hasItem("category")); 98 } 99 100 /** 83 101 * Unit test for {@link ImageryHandler#buildImageryInfo()} 84 102 * @throws Exception if any error occurs … … 87 105 public void testBuildImageryInfo() throws Exception { 88 106 String url = "https://localhost/imagery?title=osm" 89 + "&type=tms&min_zoom=3&max_zoom=23 "107 + "&type=tms&min_zoom=3&max_zoom=23&category=osmbasedmap&country_code=XA" 90 108 + "&url=https://a.tile.openstreetmap.org/%7Bzoom%7D/%7Bx%7D/%7By%7D.png"; 91 109 ImageryInfo imageryInfo = newHandler(url).buildImageryInfo(); … … 95 113 assertEquals(3, imageryInfo.getMinZoom()); 96 114 assertEquals(23, imageryInfo.getMaxZoom()); 115 assertEquals(ImageryInfo.ImageryCategory.OSMBASEDMAP, imageryInfo.getImageryCategory()); 116 assertEquals("XA", imageryInfo.getCountryCode()); 97 117 } 98 118 }
Note:
See TracChangeset
for help on using the changeset viewer.