Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (4 years 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/data/osm/history
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java

    r12663 r17275  
    22package org.openstreetmap.josm.data.osm.history;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.util.Date;
     
    99import java.util.Map;
    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.coor.LatLon;
    1414import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
     
    2323 * Unit tests for class {@link HistoryNode}.
    2424 */
    25 public class HistoryNodeTest {
     25class HistoryNodeTest {
    2626
    2727    /**
    2828     * Setup test.
    2929     */
    30     @Rule
     30    @RegisterExtension
    3131    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3232    public JOSMTestRules test = new JOSMTestRules();
     
    4848     */
    4949    @Test
    50     public void testHistoryNode() {
     50    void testHistoryNode() {
    5151        Date d = new Date();
    5252        HistoryNode node = create(d);
     
    6565     */
    6666    @Test
    67     public void testGetType() {
     67    void testGetType() {
    6868        assertEquals(OsmPrimitiveType.NODE, create(new Date()).getType());
    6969    }
     
    7373     */
    7474    @Test
    75     public void testGetCoords() {
     75    void testGetCoords() {
    7676        Node n = new Node(new LatLon(45, 0));
    7777        n.setOsmId(1, 2);
     
    8585     */
    8686    @Test
    87     public void testGetDisplayName() {
     87    void testGetDisplayName() {
    8888        HistoryNode node = create(new Date());
    8989        HistoryNameFormatter hnf = DefaultNameFormatter.getInstance();
  • trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryRelationTest.java

    r12663 r17275  
    22package org.openstreetmap.josm.data.osm.history;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.util.Date;
     
    99import java.util.Map;
    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.osm.DefaultNameFormatter;
    1414import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    2222 * Unit tests for class {@link HistoryRelation}.
    2323 */
    24 public class HistoryRelationTest {
     24class HistoryRelationTest {
    2525
    2626    /**
    2727     * Setup test.
    2828     */
    29     @Rule
     29    @RegisterExtension
    3030    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3131    public JOSMTestRules test = new JOSMTestRules();
     
    4646     */
    4747    @Test
    48     public void testHistoryRelation() {
     48    void testHistoryRelation() {
    4949        Date d = new Date();
    5050        HistoryRelation rel = create(d);
     
    6363     */
    6464    @Test
    65     public void testGetType() {
     65    void testGetType() {
    6666        assertEquals(OsmPrimitiveType.RELATION, create(new Date()).getType());
    6767    }
     
    7171     */
    7272    @Test
    73     public void testGetDisplayName() {
     73    void testGetDisplayName() {
    7474        HistoryNameFormatter hnf = DefaultNameFormatter.getInstance();
    7575        HistoryRelation rel0 = create(new Date()); // 0 member
  • trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java

    r16445 r17275  
    22package org.openstreetmap.josm.data.osm.history;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertTrue;
    6 import static org.junit.Assert.fail;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
     6import static org.junit.jupiter.api.Assertions.fail;
    77
    88import java.util.Date;
     
    1111import java.util.Map;
    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.data.osm.DefaultNameFormatter;
    1616import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    2424 * Unit tests for class {@link HistoryWay}.
    2525 */
    26 public class HistoryWayTest {
     26class HistoryWayTest {
    2727
    2828    /**
    2929     * Setup test.
    3030     */
    31     @Rule
     31    @RegisterExtension
    3232    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3333    public JOSMTestRules test = new JOSMTestRules();
     
    4848     */
    4949    @Test
    50     public void testHistoryWay() {
     50    void testHistoryWay() {
    5151        Date d = new Date();
    5252        HistoryWay way = create(d);
     
    6767     */
    6868    @Test
    69     public void testGetType() {
     69    void testGetType() {
    7070        assertEquals(OsmPrimitiveType.WAY, create(new Date()).getType());
    7171    }
    7272
    7373    @Test
    74     public void testNodeManipulation() {
     74    void testNodeManipulation() {
    7575        HistoryWay way = create(new Date());
    7676
     
    9292
    9393    @Test
    94     public void testIterating() {
     94    void testIterating() {
    9595        HistoryWay way = create(new Date());
    9696
     
    108108     */
    109109    @Test
    110     public void testGetDisplayName() {
     110    void testGetDisplayName() {
    111111        HistoryNameFormatter hnf = DefaultNameFormatter.getInstance();
    112112        HistoryWay way0 = create(new Date()); // no node
Note: See TracChangeset for help on using the changeset viewer.