source: josm/trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/ImageMarkerTest.java@ 17275

Last change on this file since 17275 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.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.layer.markerlayer;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5
6import java.net.MalformedURLException;
7import java.net.URL;
8
9import org.junit.jupiter.api.BeforeAll;
10import org.junit.jupiter.api.Test;
11import org.openstreetmap.josm.JOSMFixture;
12import org.openstreetmap.josm.data.coor.LatLon;
13import org.openstreetmap.josm.data.gpx.GpxData;
14import org.openstreetmap.josm.data.gpx.WayPoint;
15
16/**
17 * Unit tests of {@link ImageMarker} class.
18 */
19class ImageMarkerTest {
20
21 /**
22 * Setup tests
23 */
24 @BeforeAll
25 public static void setUpBeforeClass() {
26 JOSMFixture.createUnitTestFixture().init();
27 }
28
29 /**
30 * Unit test of {@link ImageMarker#ImageMarker}.
31 * @throws MalformedURLException never
32 */
33 @Test
34 void testImageMarker() throws MalformedURLException {
35 ImageMarker marker = new ImageMarker(
36 LatLon.ZERO,
37 new URL("file://something.jpg"),
38 new MarkerLayer(new GpxData(), null, null, null),
39 1d, 2d);
40 marker.actionPerformed(null);
41 assertEquals("", marker.getText());
42 WayPoint wpt = marker.convertToWayPoint();
43 assertEquals(LatLon.ZERO, wpt.getCoor());
44 }
45}
Note: See TracBrowser for help on using the repository browser.