Ignore:
Timestamp:
2020-10-28T20:41:00+01:00 (3 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

File:
1 edited

Legend:

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

    r14977 r17275  
    22package org.openstreetmap.josm.actions;
    33
    4 import static org.junit.Assert.assertSame;
    5 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertSame;
     5import static org.junit.jupiter.api.Assertions.assertTrue;
    66
    77import java.lang.reflect.Field;
     
    99import java.util.Collection;
    1010
    11 import org.junit.Rule;
    12 import org.junit.Test;
     11import org.junit.jupiter.api.Test;
     12import org.junit.jupiter.api.extension.RegisterExtension;
    1313import org.openstreetmap.josm.data.coor.EastNorth;
    1414import org.openstreetmap.josm.data.coor.LatLon;
     
    2929 * Unit tests for class {@link CreateCircleAction}.
    3030 */
    31 public final class CreateCircleActionTest {
     31final class CreateCircleActionTest {
    3232
    3333    /**
    3434     * Setup test.
    3535     */
    36     @Rule
     36    @RegisterExtension
    3737    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3838    public JOSMTestRules test = new JOSMTestRules().projection();
     
    4545     */
    4646    @Test
    47     public void testTicket7421case0() throws ReflectiveOperationException {
     47    void testTicket7421case0() throws ReflectiveOperationException {
    4848        DataSet dataSet = new DataSet();
    4949
     
    6565        // Expected result: Dataset contain one closed way, clockwise
    6666        Collection<Way> resultingWays = dataSet.getWays();
    67         assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()),
    68                    resultingWays.size(), 1);
     67        assertSame(1, resultingWays.size(), String.format("Expect one way after perform action. %d found", resultingWays.size()));
    6968        Way resultingWay = resultingWays.iterator().next();
    70         assertTrue("Resulting way is not closed",
    71                    resultingWay.isClosed());
    72         assertTrue("Found anti-clockwize circle while way was clockwize",
    73                    Geometry.isClockwise(resultingWay));
     69        assertTrue(resultingWay.isClosed(), "Resulting way is not closed");
     70        assertTrue(Geometry.isClockwise(resultingWay), "Found anti-clockwise circle while way was clockwise");
    7471    }
    7572
     
    10299     */
    103100    @Test
    104     public void testTicket7421case1() throws ReflectiveOperationException {
     101    void testTicket7421case1() throws ReflectiveOperationException {
    105102        DataSet dataSet = new DataSet();
    106103
     
    127124            // Expected result: Dataset contain one closed way, clockwise
    128125            Collection<Way> resultingWays = dataSet.getWays();
    129             assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()),
    130                        resultingWays.size(), 1);
     126            assertSame(1, resultingWays.size(), String.format("Expect one way after perform action. %d found", resultingWays.size()));
    131127            Way resultingWay = resultingWays.iterator().next();
    132             assertTrue("Resulting way is not closed",
    133                        resultingWay.isClosed());
    134             assertTrue("Found anti-clockwise way while traffic is left hand.",
    135                        Geometry.isClockwise(resultingWay));
     128            assertTrue(resultingWay.isClosed(), "Resulting way is not closed");
     129            assertTrue(Geometry.isClockwise(resultingWay), "Found anti-clockwise way while traffic is left hand.");
    136130        } finally {
    137131            // Restore left/right hand traffic database
Note: See TracChangeset for help on using the changeset viewer.