Ignore:
Timestamp:
2023-03-13T21:59:27+01:00 (14 months 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/data/osm/NodeDataTest.java

    r17275 r18690  
    22package org.openstreetmap.josm.data.osm;
    33
     4import static org.junit.jupiter.api.Assertions.assertEquals;
    45import static org.junit.jupiter.api.Assertions.assertNull;
    56import static org.junit.jupiter.api.Assertions.assertTrue;
     
    1112import java.io.ObjectOutputStream;
    1213
    13 import org.junit.Assert;
    1414import org.junit.jupiter.api.Test;
    1515import org.openstreetmap.josm.data.coor.LatLon;
     
    3838        data.setChangesetId(314159);
    3939        final NodeData readData = serializeUnserialize(data);
    40         Assert.assertEquals(data.toString(), readData.toString());
     40        assertEquals(data.toString(), readData.toString());
    4141    }
    4242
Note: See TracChangeset for help on using the changeset viewer.