Changeset 17125 in josm


Ignore:
Timestamp:
2020-10-08T22:32:52+02:00 (6 months ago)
Author:
simon04
Message:

see #18200 - Fix WebMarkerTest after JMockit update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/WebMarkerTest.java

    r14412 r17125  
    22package org.openstreetmap.josm.gui.layer.markerlayer;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    66import java.net.URL;
    77
    8 import org.junit.BeforeClass;
    9 import org.junit.Test;
    10 import org.openstreetmap.josm.JOSMFixture;
     8import org.junit.jupiter.api.Test;
     9import org.junit.jupiter.api.extension.RegisterExtension;
    1110import org.openstreetmap.josm.TestUtils;
    1211import org.openstreetmap.josm.data.coor.LatLon;
    1312import org.openstreetmap.josm.data.gpx.GpxData;
    1413import org.openstreetmap.josm.data.gpx.WayPoint;
     14import org.openstreetmap.josm.testutils.JOSMTestRules;
    1515import org.openstreetmap.josm.tools.PlatformManager;
    1616import org.openstreetmap.josm.tools.PlatformHook;
    1717
     18import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1819
    1920import mockit.Expectations;
    2021import mockit.Injectable;
     22import mockit.Mocked;
    2123
    2224/**
     
    2830     * Setup tests
    2931     */
    30     @BeforeClass
    31     public static void setUpBeforeClass() {
    32         JOSMFixture.createUnitTestFixture().init();
    33     }
     32    @RegisterExtension
     33    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     34    public JOSMTestRules test = new JOSMTestRules().preferences().https();
    3435
    3536    /**
    3637     * Unit test of {@link WebMarker#WebMarker}.
    3738     * @param mockPlatformHook platform hook mock
     39     * @param platformManager {@link PlatformManager} mock
    3840     * @throws Exception  in case of error
    3941     */
    4042    @Test
    41     public void testWebMarker(@Injectable final PlatformHook mockPlatformHook) throws Exception {
     43    public void testWebMarker(@Injectable final PlatformHook mockPlatformHook,
     44                              @Mocked final PlatformManager platformManager) throws Exception {
    4245        TestUtils.assumeWorkingJMockit();
    43         new Expectations(PlatformManager.class) {{
     46        new Expectations() {{
    4447            PlatformManager.getPlatform(); result = mockPlatformHook;
    45         }};
    46         new Expectations() {{
    4748            mockPlatformHook.openUrl("http://example.com"); result = null; times = 1;
    4849        }};
Note: See TracChangeset for help on using the changeset viewer.