source: josm/trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java@ 17531

Last change on this file since 17531 was 17275, checked in by Don-vip, 3 years ago

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

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

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.datatransfer.importers;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5import static org.junit.jupiter.api.Assertions.assertNull;
6
7import org.junit.jupiter.api.extension.RegisterExtension;
8import org.junit.jupiter.api.Test;
9import org.openstreetmap.josm.data.coor.LatLon;
10import org.openstreetmap.josm.testutils.JOSMTestRules;
11
12import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13
14/**
15 * Test {@link OsmLinkPaster}
16 * @author Michael Zangl
17 */
18class OsmLinkPasterTest {
19 /**
20 * No dependencies
21 */
22 @RegisterExtension
23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
24 public JOSMTestRules test = new JOSMTestRules();
25
26 /**
27 * Test of {@link OsmLinkPaster#parseLatLon(String)}
28 */
29 @Test
30 void testParseLatLon() {
31 assertEquals(new LatLon(51.71873, 8.76164),
32 OsmLinkPaster.parseLatLon("https://www.openstreetmap.org/#map=17/51.71873/8.76164"));
33 assertNull(OsmLinkPaster.parseLatLon("http://www.openstreetmap.org/"));
34 assertNull(OsmLinkPaster.parseLatLon("foo-bar"));
35 }
36}
Note: See TracBrowser for help on using the repository browser.