Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.datatransfer.importers;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
---|
5 | import static org.junit.jupiter.api.Assertions.assertNull;
|
---|
6 |
|
---|
7 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
8 | import org.junit.jupiter.api.Test;
|
---|
9 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
10 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
11 |
|
---|
12 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Test {@link OsmLinkPaster}
|
---|
16 | * @author Michael Zangl
|
---|
17 | */
|
---|
18 | class 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.