Ignore:
Timestamp:
2023-03-13T21:59:27+01:00 (3 years ago)
Author:
taylor.smock
Message:

See #16567: Convert all assertion calls to JUnit 5 (patch by gaben, modified)

The modifications are as follows:

  • Merge DomainValidatorTest.testIDN and DomainValidatorTest.testIDNJava6OrLater
  • Update some tests to use @ParameterizedTest (DomainValidatorTest)
  • Replace various exception blocks with assertThrows. These typically looked like
        try {
            // Something that should throw an exception here
            fail("An exception should have been thrown");
        } catch (Exception e) {
            // Verify the exception matches expectations here
        }
    
  • Replace assertTrue(val instanceof Clazz) with assertInstanceOf
  • Replace JUnit 4 @Suite with JUnit 5 @Suite

Both the original patch and the modified patch fix various lint issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java

    r18208 r18690  
    117117        I18n.init();
    118118        // initialize the platform hook, and
    119         // call the really early hook before we anything else
     119        // call the really early hook before anything else
    120120        PlatformManager.getPlatform().preStartupHook();
    121121
     
    150150
    151151        if (createGui) {
    152             GuiHelper.runInEDTAndWaitWithException(() -> setupGUI());
     152            GuiHelper.runInEDTAndWaitWithException(this::setupGUI);
    153153        }
    154154    }
Note: See TracChangeset for help on using the changeset viewer.