Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (12 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/imagery
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 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));
Note: See TracChangeset for help on using the changeset viewer.