Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (11 months ago)
Author:
Don-vip
Message:

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

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

Location:
trunk/test/unit/org/openstreetmap/josm/gui/preferences
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java

    r16979 r17275  
    22package org.openstreetmap.josm.gui.preferences;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    55
    66/**
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java

    r10758 r17275  
    1212
    1313import org.junit.Assert;
    14 import org.junit.Test;
     14import org.junit.jupiter.api.Test;
    1515import org.openstreetmap.josm.actions.ActionParameter;
    1616import org.openstreetmap.josm.actions.ActionParameter.StringActionParameter;
     
    2222 * Unit tests of {@link ToolbarPreferences} class.
    2323 */
    24 public class ToolbarPreferencesTest {
     24class ToolbarPreferencesTest {
    2525
    2626    private static class TestAction extends AbstractAction implements ParameterizedAction {
     
    5858
    5959    @Test
    60     public void testCase1() {
     60    void testCase1() {
    6161        Map<String, Action> actions = new HashMap<>();
    6262        actions.put("action", new TestAction());
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.advanced;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link AdvancedPreference} class.
    1313 */
    14 public class AdvancedPreferenceTest {
     14class AdvancedPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testAdvancedPreference() {
     28    void testAdvancedPreference() {
    2929        assertNotNull(new AdvancedPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new AdvancedPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java

    r16159 r17275  
    66import javax.swing.JOptionPane;
    77
    8 import org.junit.Rule;
    9 import org.junit.Test;
     8import org.junit.jupiter.api.extension.RegisterExtension;
     9import org.junit.jupiter.api.Test;
    1010import org.openstreetmap.josm.TestUtils;
    1111import org.openstreetmap.josm.data.Preferences;
     
    1818 * Unit tests of {@link ExportProfileAction} class.
    1919 */
    20 public class ExportProfileActionTest {
     20class ExportProfileActionTest {
    2121    /**
    2222     * Setup tests
    2323     */
    24     @Rule
     24    @RegisterExtension
    2525    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2626    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
     
    3030     */
    3131    @Test
    32     public void testAction() {
     32    void testAction() {
    3333        TestUtils.assumeWorkingJMockit();
    3434        new JOptionPaneSimpleMocker(Collections.singletonMap(
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ListEditorTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.advanced;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNotNull;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertNotNull;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.util.Arrays;
    99
    10 import org.junit.BeforeClass;
    11 import org.junit.Test;
     10import org.junit.jupiter.api.BeforeAll;
     11import org.junit.jupiter.api.Test;
    1212import org.openstreetmap.josm.JOSMFixture;
    1313import org.openstreetmap.josm.gui.preferences.advanced.ListEditor.ListSettingTableModel;
     
    1616 * Unit tests of {@link ListEditor} class.
    1717 */
    18 public class ListEditorTest {
     18class ListEditorTest {
    1919
    2020    /**
    2121     * Setup test.
    2222     */
    23     @BeforeClass
     23    @BeforeAll
    2424    public static void setUpBeforeClass() {
    2525        JOSMFixture.createUnitTestFixture().init();
     
    3030     */
    3131    @Test
    32     public void testListSettingTableModel() {
     32    void testListSettingTableModel() {
    3333        ListSettingTableModel model = new ListSettingTableModel(null);
    3434        assertNotNull(model.getData());
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java

    r13079 r17275  
    22package org.openstreetmap.josm.gui.preferences.advanced;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    8 import org.junit.BeforeClass;
    9 import org.junit.Test;
     8import org.junit.jupiter.api.BeforeAll;
     9import org.junit.jupiter.api.Test;
    1010import org.openstreetmap.josm.JOSMFixture;
    1111import org.openstreetmap.josm.TestUtils;
     
    1717 * Unit tests of {@link PrefEntry} class.
    1818 */
    19 public class PrefEntryTest {
     19class PrefEntryTest {
    2020
    2121    /**
    2222     * Setup test.
    2323     */
    24     @BeforeClass
     24    @BeforeAll
    2525    public static void setUpBeforeClass() {
    2626        JOSMFixture.createUnitTestFixture().init();
     
    3131     */
    3232    @Test
    33     public void testPrefEntry() {
     33    void testPrefEntry() {
    3434        String key = "key";
    3535        StringSetting val = new StringSetting("value");
     
    5555     */
    5656    @Test
    57     public void testEqualsContract() {
     57    void testEqualsContract() {
    5858        TestUtils.assumeWorkingEqualsVerifier();
    5959        EqualsVerifier.forClass(PrefEntry.class).usingGetClass()
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java

    r16160 r17275  
    22package org.openstreetmap.josm.gui.preferences.advanced;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertNull;
    7 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertNull;
     7import static org.junit.jupiter.api.Assertions.assertTrue;
    88
    99import java.util.Arrays;
     
    1111import javax.swing.JOptionPane;
    1212
    13 import org.junit.Rule;
    14 import org.junit.Test;
     13import org.junit.jupiter.api.extension.RegisterExtension;
     14import org.junit.jupiter.api.Test;
    1515import org.openstreetmap.josm.TestUtils;
    1616import org.openstreetmap.josm.gui.ExtendedDialog;
     
    2626 * Unit tests of {@link PreferencesTable} class.
    2727 */
    28 public class PreferencesTableTest {
     28class PreferencesTableTest {
    2929    /**
    3030     * Setup tests
    3131     */
    32     @Rule
     32    @RegisterExtension
    3333    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3434    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
     
    4848     */
    4949    @Test
    50     public void testPreferencesTable() {
     50    void testPreferencesTable() {
    5151        TestUtils.assumeWorkingJMockit();
    5252        final JOptionPaneSimpleMocker mocker = new JOptionPaneSimpleMocker();
     
    7575     */
    7676    @Test
    77     public void testAllSettingsTableModel() {
     77    void testAllSettingsTableModel() {
    7878        AllSettingsTableModel model = (AllSettingsTableModel) newTable().getModel();
    7979        assertEquals(1, model.getRowCount());
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java

    r12849 r17275  
    22package org.openstreetmap.josm.gui.preferences.audio;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1313 * Unit tests of {@link AudioPreference} class.
    1414 */
    15 public class AudioPreferenceTest {
     15class AudioPreferenceTest {
    1616
    1717    /**
    1818     * Setup test.
    1919     */
    20     @BeforeClass
     20    @BeforeAll
    2121    public static void setUpBeforeClass() {
    2222        JOSMFixture.createUnitTestFixture().init();
     
    2727     */
    2828    @Test
    29     public void testAudioPreference() {
     29    void testAudioPreference() {
    3030        assertNotNull(new AudioPreference.Factory().createPreferenceSetting());
    3131    }
     
    3535     */
    3636    @Test
    37     public void testAddGui() {
     37    void testAddGui() {
    3838        Config.getPref().putBoolean("audio.menuinvisible", true);
    3939        PreferencesTestUtils.doTestPreferenceSettingAddGui(new AudioPreference.Factory(), null);
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.display;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link ColorPreference} class.
    1313 */
    14 public class ColorPreferenceTest {
     14class ColorPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testColorPreference() {
     28    void testColorPreference() {
    2929        assertNotNull(new ColorPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ColorPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.display;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link DisplayPreference} class.
    1313 */
    14 public class DisplayPreferenceTest {
     14class DisplayPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testDisplayPreference() {
     28    void testDisplayPreference() {
    2929        assertNotNull(new DisplayPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new DisplayPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.display;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link DrawingPreference} class.
    1313 */
    14 public class DrawingPreferenceTest {
     14class DrawingPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testDrawingPreference() {
     28    void testDrawingPreference() {
    2929        assertNotNull(new DrawingPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new DrawingPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/GPXPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.display;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link GPXPreference} class.
    1313 */
    14 public class GPXPreferenceTest {
     14class GPXPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testGPXPreference() {
     28    void testGPXPreference() {
    2929        assertNotNull(new GPXPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new GPXPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.display;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link LafPreference} class.
    1313 */
    14 public class LafPreferenceTest {
     14class LafPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testLafPreference() {
     28    void testLafPreference() {
    2929        assertNotNull(new LafPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new LafPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.display;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link LanguagePreference} class.
    1313 */
    14 public class LanguagePreferenceTest {
     14class LanguagePreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testLanguagePreference() {
     28    void testLanguagePreference() {
    2929        assertNotNull(new LanguagePreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new LanguagePreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanelTest.java

    r10977 r17275  
    22package org.openstreetmap.josm.gui.preferences.imagery;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
    66
    7 import org.junit.Rule;
    8 import org.junit.Test;
     7import org.junit.jupiter.api.extension.RegisterExtension;
     8import org.junit.jupiter.api.Test;
    99import org.openstreetmap.josm.testutils.JOSMTestRules;
    1010
     
    1414 * Unit tests of {@link AddTMSLayerPanel} class.
    1515 */
    16 public class AddTMSLayerPanelTest {
     16class AddTMSLayerPanelTest {
    1717
    1818    /**
    1919     * Setup tests
    2020     */
    21     @Rule
     21    @RegisterExtension
    2222    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2323    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    2727     */
    2828    @Test
    29     public void testAddTMSLayerPanel() {
     29    void testAddTMSLayerPanel() {
    3030        AddTMSLayerPanel panel = new AddTMSLayerPanel();
    3131        assertEquals("", panel.getImageryInfo().getUrl());
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java

    r14138 r17275  
    22package org.openstreetmap.josm.gui.preferences.imagery;
    33
    4 import static org.junit.Assert.assertFalse;
     4import static org.junit.jupiter.api.Assertions.assertFalse;
    55
    6 import org.junit.Rule;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.extension.RegisterExtension;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.testutils.JOSMTestRules;
    99
     
    1313 * Unit tests of {@link AddWMSLayerPanel} class.
    1414 */
    15 public class AddWMSLayerPanelTest {
     15class AddWMSLayerPanelTest {
    1616
    1717    /**
    1818     * Setup tests
    1919     */
    20     @Rule
     20    @RegisterExtension
    2121    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2222    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    2626     */
    2727    @Test
    28     public void testAddWMSLayerPanel() {
     28    void testAddWMSLayerPanel() {
    2929        AddWMSLayerPanel panel = new AddWMSLayerPanel();
    3030        assertFalse(panel.isImageryValid());
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanelTest.java

    r10977 r17275  
    22package org.openstreetmap.josm.gui.preferences.imagery;
    33
    4 import static org.junit.Assert.assertFalse;
     4import static org.junit.jupiter.api.Assertions.assertFalse;
     5import static org.junit.jupiter.api.Assertions.assertThrows;
    56
    6 import org.junit.Rule;
    7 import org.junit.Test;
     7import org.junit.jupiter.api.Test;
     8import org.junit.jupiter.api.extension.RegisterExtension;
    89import org.openstreetmap.josm.testutils.JOSMTestRules;
    910
     
    1314 * Unit tests of {@link AddWMTSLayerPanel} class.
    1415 */
    15 public class AddWMTSLayerPanelTest {
     16class AddWMTSLayerPanelTest {
    1617
    1718    /**
    1819     * Setup tests
    1920     */
    20     @Rule
     21    @RegisterExtension
    2122    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2223    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    2627     */
    2728    @Test
    28     public void testAddWMTSLayerPanel() {
     29    void testAddWMTSLayerPanel() {
    2930        AddWMTSLayerPanel panel = new AddWMTSLayerPanel();
    3031        assertFalse(panel.isImageryValid());
     
    3435     * Unit test of {@link AddWMTSLayerPanel#getImageryInfo}.
    3536     */
    36     @Test(expected = IllegalArgumentException.class)
    37     public void testGetImageryInfo() {
    38         new AddWMTSLayerPanel().getImageryInfo();
     37    @Test
     38    void testGetImageryInfo() {
     39        assertThrows(IllegalArgumentException.class, () -> new AddWMTSLayerPanel().getImageryInfo());
    3940    }
    4041}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java

    r14138 r17275  
    22package org.openstreetmap.josm.gui.preferences.imagery;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    66import java.io.File;
    77import java.util.Arrays;
    88
    9 import org.junit.Rule;
    10 import org.junit.Test;
     9import org.junit.jupiter.api.extension.RegisterExtension;
     10import org.junit.jupiter.api.Test;
    1111import org.openstreetmap.josm.TestUtils;
    1212import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1919 * Unit tests of {@link ImageryPreference} class.
    2020 */
    21 public class ImageryPreferenceTest {
     21class ImageryPreferenceTest {
    2222
    2323    /**
    2424     * Setup tests
    2525     */
    26     @Rule
     26    @RegisterExtension
    2727    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2828    public JOSMTestRules test = new JOSMTestRules().main();
     
    3232     */
    3333    @Test
    34     public void testImageryPreference() {
     34    void testImageryPreference() {
    3535        assertNotNull(new ImageryPreference.Factory().createPreferenceSetting());
    3636    }
     
    4040     */
    4141    @Test
    42     public void testAddGui() {
     42    void testAddGui() {
    4343        String fileUrl = new File(TestUtils.getTestDataRoot()+"__files/imagery/maps.xml").toURI().toString();
    4444        Config.getPref().putList("imagery.layers.sites", Arrays.asList(fileUrl));
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java

    r16824 r17275  
    396396    @ParameterizedTest(name = "{0}")
    397397    @MethodSource("data")
    398     public void testImageryEntryValidity(String id, ImageryInfo info) {
     398    void testImageryEntryValidity(String id, ImageryInfo info) {
    399399        checkEntry(info);
    400400        assertTrue(errors.isEmpty(), format(errors));
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.map;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link BackupPreference} class.
    1313 */
    14 public class BackupPreferenceTest {
     14class BackupPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testBackupPreference() {
     28    void testBackupPreference() {
    2929        assertNotNull(new BackupPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new BackupPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.map;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link MapPaintPreference} class.
    1313 */
    14 public class MapPaintPreferenceTest {
     14class MapPaintPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testMapPaintPreference() {
     28    void testMapPaintPreference() {
    2929        assertNotNull(new MapPaintPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new MapPaintPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java

    r15101 r17275  
    22package org.openstreetmap.josm.gui.preferences.map;
    33
    4 import static org.junit.Assert.assertTrue;
    54import static org.junit.Assume.assumeFalse;
    65import static org.junit.Assume.assumeTrue;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
    77
    88import java.io.IOException;
     
    1010import java.util.List;
    1111
    12 import org.junit.BeforeClass;
    1312import org.junit.ClassRule;
    14 import org.junit.Test;
     13import org.junit.jupiter.api.BeforeAll;
     14import org.junit.jupiter.api.Test;
    1515import org.junit.runner.RunWith;
    1616import org.junit.runners.Parameterized.Parameters;
     
    3535 */
    3636@RunWith(ParallelParameterized.class)
    37 public class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
     37class MapPaintPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
    3838
    3939    /**
     
    4848     * @throws IOException in case of I/O error
    4949     */
    50     @BeforeClass
     50    @BeforeAll
    5151    public static void beforeClass() throws IOException {
    5252        errorsToIgnore.addAll(TestUtils.getIgnoredErrorMessages(MapPaintPreferenceTestIT.class));
     
    7070     * @param source source entry to test
    7171     */
    72     public MapPaintPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
     72    MapPaintPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
    7373        super(source);
    7474    }
     
    7979     */
    8080    @Test
    81     public void testStyleValidity() throws Exception {
     81    void testStyleValidity() throws Exception {
    8282        assumeFalse(isIgnoredSubstring(source.url));
    8383        StyleSource style = MapPaintStyles.addStyle(source);
     
    108108        warnings.removeAll(ignoredErrors);
    109109
    110         assertTrue(errors.toString() + '\n' + warnings.toString(), errors.isEmpty() && warnings.isEmpty());
     110        assertTrue(errors.isEmpty() && warnings.isEmpty(), errors.toString() + '\n' + warnings.toString());
    111111        assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty());
    112112    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.map;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link MapPreference} class.
    1313 */
    14 public class MapPreferenceTest {
     14class MapPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testMapPreference() {
     28    void testMapPreference() {
    2929        assertNotNull(new MapPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new MapPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.map;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link TaggingPresetPreference} class.
    1313 */
    14 public class TaggingPresetPreferenceTest {
     14class TaggingPresetPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testTaggingPresetPreference() {
     28    void testTaggingPresetPreference() {
    2929        assertNotNull(new TaggingPresetPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new TaggingPresetPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java

    r16768 r17275  
    22package org.openstreetmap.josm.gui.preferences.map;
    33
    4 import static org.junit.Assert.assertFalse;
    5 import static org.junit.Assert.assertTrue;
    64import static org.junit.Assume.assumeFalse;
    75import static org.junit.Assume.assumeTrue;
     6import static org.junit.jupiter.api.Assertions.assertFalse;
     7import static org.junit.jupiter.api.Assertions.assertTrue;
    88
    99import java.io.IOException;
     
    1515import java.util.Set;
    1616
    17 import org.junit.BeforeClass;
    1817import org.junit.ClassRule;
    19 import org.junit.Test;
     18import org.junit.jupiter.api.BeforeAll;
     19import org.junit.jupiter.api.Test;
    2020import org.junit.runner.RunWith;
    2121import org.junit.runners.Parameterized;
     
    4141 */
    4242@RunWith(Parameterized.class)
    43 public class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
     43class TaggingPresetPreferenceTestIT extends AbstractExtendedSourceEntryTestCase {
    4444
    4545    /**
     
    5454     * @throws IOException in case of I/O error
    5555     */
    56     @BeforeClass
     56    @BeforeAll
    5757    public static void beforeClass() throws IOException {
    5858        errorsToIgnore.addAll(TestUtils.getIgnoredErrorMessages(TaggingPresetPreferenceTestIT.class));
     
    8181     * @param source source entry to test
    8282     */
    83     public TaggingPresetPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
     83    TaggingPresetPreferenceTestIT(String displayName, String url, ExtendedSourceEntry source) {
    8484        super(source);
    8585    }
     
    9090     */
    9191    @Test
    92     public void testPresetsValidity() throws Exception {
     92    void testPresetsValidity() throws Exception {
    9393        assumeFalse(isIgnoredSubstring(source.url));
    9494        Set<String> errors = new HashSet<>();
     
    106106            handleException(e, errors);
    107107        }
    108         assertTrue(errors.toString(), errors.isEmpty());
     108        assertTrue(errors.isEmpty(), errors::toString);
    109109        assumeTrue(ignoredErrors.toString(), ignoredErrors.isEmpty());
    110110    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java

    r16160 r17275  
    22package org.openstreetmap.josm.gui.preferences.plugin;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertNotNull;
    66
    77import java.io.File;
     
    1010import java.util.Collections;
    1111
    12 import org.junit.Rule;
    13 import org.junit.Test;
     12import org.junit.jupiter.api.Test;
     13import org.junit.jupiter.api.extension.RegisterExtension;
    1414import org.openstreetmap.josm.TestUtils;
    1515import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1818import org.openstreetmap.josm.plugins.PluginException;
    1919import org.openstreetmap.josm.plugins.PluginInformation;
     20import org.openstreetmap.josm.testutils.JOSMTestRules;
    2021import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
    21 import org.openstreetmap.josm.testutils.JOSMTestRules;
    2222
    2323import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    3030     * Setup test.
    3131     */
    32     @Rule
     32    @RegisterExtension
    3333    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3434    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
     
    3838     */
    3939    @Test
    40     public void testPluginPreference() {
     40    void testPluginPreference() {
    4141        assertNotNull(new PluginPreference.Factory().createPreferenceSetting());
    4242    }
     
    5757     */
    5858    @Test
    59     public void testBuildDownloadSummary() throws Exception {
     59    void testBuildDownloadSummary() throws Exception {
    6060        final PluginInformation dummy = getDummyPluginInformation();
    6161        assertEquals("", PluginPreference.buildDownloadSummary(
     
    8989     */
    9090    @Test
    91     public void testNotifyDownloadResults() {
     91    void testNotifyDownloadResults() {
    9292        final HelpAwareOptionPaneMocker mocker = new HelpAwareOptionPaneMocker();
    9393        mocker.getMockResultMap().put("<html></html>", "OK");  // (buildDownloadSummary() output was empty)
     
    103103     */
    104104    @Test
    105     public void testAddGui() {
     105    void testAddGui() {
    106106        PreferencesTestUtils.doTestPreferenceSettingAddGui(new PluginPreference.Factory(), null);
    107107    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.projection;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link ProjectionPreference} class.
    1313 */
    14 public class ProjectionPreferenceTest {
     14class ProjectionPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testProjectionPreference() {
     28    void testProjectionPreference() {
    2929        assertNotNull(new ProjectionPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProjectionPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.remotecontrol;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link RemoteControlPreference} class.
    1313 */
    14 public class RemoteControlPreferenceTest {
     14class RemoteControlPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testRemoteControlPreference() {
     28    void testRemoteControlPreference() {
    2929        assertNotNull(new RemoteControlPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new RemoteControlPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java

    r17179 r17275  
    22package org.openstreetmap.josm.gui.preferences.server;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.Rule;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.extension.RegisterExtension;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    99import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    1414 * Unit tests of {@link ProxyPreference} class.
    1515 */
    16 public class ProxyPreferenceTest {
     16class ProxyPreferenceTest {
    1717
    1818    /**
    1919     * Setup tests
    2020     */
    21     @Rule
     21    @RegisterExtension
    2222    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2323    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    2727     */
    2828    @Test
    29     public void testProxyPreference() {
     29    void testProxyPreference() {
    3030        assertNotNull(new ProxyPreference.Factory().createPreferenceSetting());
    3131    }
     
    3535     */
    3636    @Test
    37     public void testAddGui() {
     37    void testAddGui() {
    3838        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProxyPreference.Factory(), null);
    3939    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java

    r14138 r17275  
    22package org.openstreetmap.josm.gui.preferences.server;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.Rule;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.extension.RegisterExtension;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    99import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    1414 * Unit tests of {@link ServerAccessPreference} class.
    1515 */
    16 public class ServerAccessPreferenceTest {
     16class ServerAccessPreferenceTest {
    1717
    1818    /**
    1919     * Setup tests
    2020     */
    21     @Rule
     21    @RegisterExtension
    2222    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    2323    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    2727     */
    2828    @Test
    29     public void testServerAccessPreference() {
     29    void testServerAccessPreference() {
    3030        assertNotNull(new ServerAccessPreference.Factory().createPreferenceSetting());
    3131    }
     
    3535     */
    3636    @Test
    37     public void testAddGui() {
     37    void testAddGui() {
    3838        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null);
    3939    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.shortcut;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link ShortcutPreference} class.
    1313 */
    14 public class ShortcutPreferenceTest {
     14class ShortcutPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testShortcutPreference() {
     28    void testShortcutPreference() {
    2929        assertNotNull(new ShortcutPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ShortcutPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.validator;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link ValidatorPreference} class.
    1313 */
    14 public class ValidatorPreferenceTest {
     14class ValidatorPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testValidatorPreference() {
     28    void testValidatorPreference() {
    2929        assertNotNull(new ValidatorPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ValidatorPreference.Factory(), null);
    3838    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreferenceTestIT.java

    r14719 r17275  
    22package org.openstreetmap.josm.gui.preferences.validator;
    33
    4 import static org.junit.Assert.assertFalse;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertFalse;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.io.IOException;
     
    99import java.util.Collection;
    1010
    11 import org.junit.Rule;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.extension.RegisterExtension;
     12import org.junit.jupiter.api.Test;
    1313import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry;
    1414import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
     
    2121 * Integration tests of {@link ValidatorTagCheckerRulesPreference} class.
    2222 */
    23 public class ValidatorTagCheckerRulesPreferenceTestIT {
     23class ValidatorTagCheckerRulesPreferenceTestIT {
    2424
    2525    /**
    2626     * Setup rule
    2727     */
    28     @Rule
     28    @RegisterExtension
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3030    public JOSMTestRules test = new JOSMTestRules().https().timeout(20_000);
     
    3535     */
    3636    @Test
    37     public void testValidityOfAvailableRules() throws Exception {
     37    void testValidityOfAvailableRules() throws Exception {
    3838        Collection<ExtendedSourceEntry> sources = new ValidatorTagCheckerRulesPreference.TagCheckerRulesSourceEditor()
    3939                .loadAndGetAvailableSources();
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java

    r10378 r17275  
    22package org.openstreetmap.josm.gui.preferences.validator;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    6 import org.junit.BeforeClass;
    7 import org.junit.Test;
     6import org.junit.jupiter.api.BeforeAll;
     7import org.junit.jupiter.api.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    99import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     
    1212 * Unit tests of {@link ValidatorTestsPreference} class.
    1313 */
    14 public class ValidatorTestsPreferenceTest {
     14class ValidatorTestsPreferenceTest {
    1515
    1616    /**
    1717     * Setup test.
    1818     */
    19     @BeforeClass
     19    @BeforeAll
    2020    public static void setUpBeforeClass() {
    2121        JOSMFixture.createUnitTestFixture().init();
     
    2626     */
    2727    @Test
    28     public void testValidatorTestsPreference() {
     28    void testValidatorTestsPreference() {
    2929        assertNotNull(new ValidatorTestsPreference.Factory().createPreferenceSetting());
    3030    }
     
    3434     */
    3535    @Test
    36     public void testAddGui() {
     36    void testAddGui() {
    3737        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ValidatorTestsPreference.Factory(), ValidatorPreference.class);
    3838    }
Note: See TracChangeset for help on using the changeset viewer.