Ignore:
Timestamp:
2023-10-16T15:19:07+02:00 (11 months ago)
Author:
taylor.smock
Message:

See #16567: Update to JUnit 5

This converts most tests to use @Annotations. There are also some performance
improvements as it relates to tests.

File:
1 edited

Legend:

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

    r17275 r18870  
    77import java.util.ArrayList;
    88import java.util.Arrays;
     9import java.util.Collections;
    910
    1011import org.junit.jupiter.api.BeforeEach;
    1112import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1313import org.openstreetmap.josm.TestUtils;
    1414import org.openstreetmap.josm.command.CommandTest.CommandTestData;
     
    2020import org.openstreetmap.josm.data.osm.User;
    2121import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    22 import org.openstreetmap.josm.testutils.JOSMTestRules;
     22import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     23import org.openstreetmap.josm.testutils.annotations.Projection;
    2324
    24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2525import nl.jqno.equalsverifier.EqualsVerifier;
    2626import nl.jqno.equalsverifier.Warning;
     
    2929 * Unit tests of {@link ScaleCommand} class.
    3030 */
     31@BasicPreferences
     32@Projection
    3133class ScaleCommandTest {
    32 
    33     /**
    34      * We need prefs for nodes.
    35      */
    36     @RegisterExtension
    37     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    38     public JOSMTestRules test = new JOSMTestRules().preferences().projection();
    3934    private CommandTestData testData;
    4035
     
    10095        ArrayList<OsmPrimitive> deleted = new ArrayList<>();
    10196        ArrayList<OsmPrimitive> added = new ArrayList<>();
    102         ScaleCommand command = new ScaleCommand(Arrays.asList(testData.existingNode),
     97        ScaleCommand command = new ScaleCommand(Collections.singletonList(testData.existingNode),
    10398                new EastNorth(0, 0));
    10499        // intentionally empty
     
    114109    @Test
    115110    void testGetParticipatingPrimitives() {
    116         ScaleCommand command = new ScaleCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0));
     111        ScaleCommand command = new ScaleCommand(Collections.singletonList(testData.existingNode), new EastNorth(0, 0));
    117112        command.executeCommand();
    118113        assertArrayEquals(new Object[] {testData.existingNode }, command.getParticipatingPrimitives().toArray());
     
    125120    void testDescription() {
    126121        assertEquals("Scale 1 node",
    127                 new ScaleCommand(Arrays.asList(testData.existingNode), new EastNorth(0, 0))
     122                new ScaleCommand(Collections.singletonList(testData.existingNode), new EastNorth(0, 0))
    128123                        .getDescriptionText());
    129124        assertEquals("Scale 2 nodes",
Note: See TracChangeset for help on using the changeset viewer.