Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (15 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/help
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java

    r13920 r17275  
    22package org.openstreetmap.josm.gui.help;
    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 HelpContentReader} class.
    1415 */
    15 public class HelpContentReaderTest {
     16class HelpContentReaderTest {
    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().timeout(30000);
     
    2425    /**
    2526     * Unit test of {@link HelpContentReader#fetchHelpTopicContent} - null case.
    26      * @throws HelpContentReaderException always
    2727     */
    28     @Test(expected = HelpContentReaderException.class)
    29     public void testFetchHelpTopicContentNull() throws HelpContentReaderException {
    30         new HelpContentReader(null).fetchHelpTopicContent(null, false);
     28    @Test
     29    void testFetchHelpTopicContentNull() {
     30        assertThrows(HelpContentReaderException.class, () -> new HelpContentReader(null).fetchHelpTopicContent(null, false));
    3131    }
    3232
     
    3636     */
    3737    @Test
    38     public void testFetchHelpTopicContentNominal() throws HelpContentReaderException {
     38    void testFetchHelpTopicContentNominal() throws HelpContentReaderException {
    3939        String res = new HelpContentReader(HelpUtil.getWikiBaseUrl()).fetchHelpTopicContent(HelpBrowserTest.URL_1, false);
    4040        assertFalse(res.trim().isEmpty());
  • trunk/test/unit/org/openstreetmap/josm/gui/help/HyperlinkHandlerTest.java

    r14807 r17275  
    22package org.openstreetmap.josm.gui.help;
    33
    4 import static org.junit.Assert.assertNotNull;
     4import static org.junit.jupiter.api.Assertions.assertNotNull;
    55
    66import java.io.StringReader;
     
    1111import javax.swing.text.html.HTMLEditorKit;
    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.gui.widgets.JosmEditorPane;
    1616import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    2121 * Unit tests of {@link HyperlinkHandler} class.
    2222 */
    23 public class HyperlinkHandlerTest {
     23class HyperlinkHandlerTest {
    2424
    2525    /**
    2626     * Setup tests
    2727     */
    28     @Rule
     28    @RegisterExtension
    2929    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3030    public JOSMTestRules test = new JOSMTestRules().preferences();
     
    3535     */
    3636    @Test
    37     public void testTicket17338() throws Exception {
     37    void testTicket17338() throws Exception {
    3838        JosmEditorPane help = new JosmEditorPane();
    3939        HTMLEditorKit htmlKit = new HTMLEditorKit();
Note: See TracChangeset for help on using the changeset viewer.