Ignore:
Timestamp:
2021-07-16T09:16:33+02:00 (6 months ago)
Author:
Don-vip
Message:

fix #21064 - Add JUnit 5 extension for preferences (patch by taylor.smock)

Location:
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java

    r17275 r18037  
    66import static org.junit.jupiter.api.Assertions.assertThrows;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
    9 import org.junit.jupiter.api.Test;
    108import org.openstreetmap.josm.data.osm.DataSet;
    119import org.openstreetmap.josm.gui.MainApplication;
    1210import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1311import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    14 import org.openstreetmap.josm.testutils.JOSMTestRules;
     12import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1513
    16 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.junit.jupiter.api.Test;
    1715
    1816/**
    1917 * Unit tests of {@link AddWayHandler} class.
    2018 */
     19@BasicPreferences
    2120class AddWayHandlerTest {
    22     /**
    23      * Setup test.
    24      */
    25     @RegisterExtension
    26     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    27     public JOSMTestRules test = new JOSMTestRules();
    28 
    2921    private static AddWayHandler newHandler(String url) throws RequestHandlerBadRequestException {
    3022        AddWayHandler req = new AddWayHandler();
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java

    r17655 r18037  
    44import static org.hamcrest.CoreMatchers.hasItem;
    55import static org.hamcrest.MatcherAssert.assertThat;
     6import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    67import static org.junit.jupiter.api.Assertions.assertEquals;
    7 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
    88import static org.junit.jupiter.api.Assertions.assertThrows;
    99
     
    1111import java.util.List;
    1212
    13 import org.junit.jupiter.api.extension.RegisterExtension;
    14 import org.junit.jupiter.api.Test;
    1513import org.openstreetmap.josm.data.imagery.ImageryInfo;
    1614import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    17 import org.openstreetmap.josm.testutils.JOSMTestRules;
     15import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1816
    19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2018
    2119/**
    2220 * Unit tests of {@link ImageryHandler} class.
    2321 */
     22@BasicPreferences
    2423class ImageryHandlerTest {
    25     /**
    26      * Setup test.
    27      */
    28     @RegisterExtension
    29     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    30     public JOSMTestRules test = new JOSMTestRules();
    31 
    3224    private static ImageryHandler newHandler(String url) throws RequestHandlerBadRequestException {
    3325        ImageryHandler req = new ImageryHandler();
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandlerTest.java

    r17275 r18037  
    66import static org.junit.jupiter.api.Assertions.assertThrows;
    77
    8 import org.junit.jupiter.api.extension.RegisterExtension;
     8import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
     9import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
     10
    911import org.junit.jupiter.api.Test;
    10 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    11 import org.openstreetmap.josm.testutils.JOSMTestRules;
    12 
    13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1412
    1513/**
     
    1715 */
    1816class LoadAndZoomHandlerTest {
    19     /**
    20      * Setup test.
    21      */
    22     @RegisterExtension
    23     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    24     public JOSMTestRules test = new JOSMTestRules();
    25 
    2617    private static LoadAndZoomHandler newHandler(String url) throws RequestHandlerBadRequestException {
    2718        LoadAndZoomHandler req = new LoadAndZoomHandler();
     
    6657     */
    6758    @Test
     59    @BasicPreferences
    6860    void testNominalRequest() throws Exception {
    6961        assertDoesNotThrow(() -> newHandler("https://localhost?bottom=0&top=0&left=1&right=1").handle());
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandlerTest.java

    r17332 r18037  
    99import static org.junit.jupiter.api.Assertions.assertThrows;
    1010
    11 import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1311import org.openstreetmap.josm.TestUtils;
    1412import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    1513import org.openstreetmap.josm.spi.preferences.Config;
    16 import org.openstreetmap.josm.testutils.JOSMTestRules;
     14import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
    1715
    1816import com.github.tomakehurst.wiremock.WireMockServer;
    19 
    20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     17import org.junit.jupiter.api.Test;
    2118
    2219/**
     
    2421 */
    2522class LoadObjectHandlerTest {
    26     /**
    27      * Setup test.
    28      */
    29     @RegisterExtension
    30     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    31     public JOSMTestRules test = new JOSMTestRules();
    32 
    3323    private static LoadObjectHandler newHandler(String url) throws RequestHandlerBadRequestException {
    3424        LoadObjectHandler req = new LoadObjectHandler();
     
    6959     */
    7060    @Test
     61    @BasicPreferences
    7162    void testNominalRequest() {
    7263        WireMockServer wiremock = TestUtils.getWireMockServer();
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java

    r17275 r18037  
    99import java.util.Map;
    1010
    11 import org.junit.jupiter.api.Test;
    12 import org.junit.jupiter.api.extension.RegisterExtension;
    1311import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    1412import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler.RequestHandlerBadRequestException;
    15 import org.openstreetmap.josm.testutils.JOSMTestRules;
    1613
    17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     14import org.junit.jupiter.api.Test;
    1815
    1916/**
     
    2118 */
    2219class RequestHandlerTest {
    23 
    24     /**
    25      * Setup test.
    26      */
    27     @RegisterExtension
    28     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    29     public JOSMTestRules test = new JOSMTestRules();
    30 
    3120    Map<String, String> getRequestParameter(String url) throws RequestHandlerBadRequestException {
    3221        final RequestHandler req = new RequestHandler() {
Note: See TracChangeset for help on using the changeset viewer.