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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java

    r10962 r17275  
    22package org.openstreetmap.josm.gui.datatransfer;
    33
    4 import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    6 import static org.junit.Assert.assertTrue;
     4import static org.junit.jupiter.api.Assertions.assertEquals;
     5import static org.junit.jupiter.api.Assertions.assertFalse;
     6import static org.junit.jupiter.api.Assertions.assertTrue;
     7import static org.junit.jupiter.api.Assertions.assertThrows;
    78import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA;
    89
     
    1213import java.util.Collections;
    1314
    14 import org.junit.Rule;
    15 import org.junit.Test;
     15import org.junit.jupiter.api.Test;
     16import org.junit.jupiter.api.extension.RegisterExtension;
    1617import org.openstreetmap.josm.data.osm.Node;
    1718import org.openstreetmap.josm.data.osm.PrimitiveData;
     
    2627 * Unit tests of {@link RelationMemberTransferable} class.
    2728 */
    28 public class RelationMemberTransferableTest {
     29class RelationMemberTransferableTest {
    2930
    3031    /**
    3132     * Setup tests
    3233     */
    33     @Rule
     34    @RegisterExtension
    3435    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    3536    public JOSMTestRules test = new JOSMTestRules();
     
    3940     */
    4041    @Test
    41     public void testGetTransferDataFlavors() {
     42    void testGetTransferDataFlavors() {
    4243        DataFlavor[] flavors = new RelationMemberTransferable(Collections.<RelationMember>emptyList()).getTransferDataFlavors();
    4344        assertEquals(3, flavors.length);
     
    5152     */
    5253    @Test
    53     public void testIsDataFlavorSupported() {
     54    void testIsDataFlavorSupported() {
    5455        RelationMemberTransferable transferable = new RelationMemberTransferable(Collections.<RelationMember>emptyList());
    5556        assertTrue(transferable.isDataFlavorSupported(RELATION_MEMBER_DATA));
     
    6364     */
    6465    @Test
    65     public void testGetTransferDataNominal() throws UnsupportedFlavorException {
     66    void testGetTransferDataNominal() throws UnsupportedFlavorException {
    6667        RelationMemberTransferable rmt = new RelationMemberTransferable(Collections.singleton(new RelationMember("test", new Node(1))));
    6768        assertEquals("node 1 test # incomplete\n", rmt.getTransferData(DataFlavor.stringFlavor));
     
    8081    /**
    8182     * Test of {@link RelationMemberTransferable#getTransferData} method - error case.
    82      * @throws UnsupportedFlavorException always
    8383     */
    84     @Test(expected = UnsupportedFlavorException.class)
    85     public void testGetTransferDataError() throws UnsupportedFlavorException {
    86         new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null);
     84    @Test
     85    void testGetTransferDataError() {
     86        assertThrows(UnsupportedFlavorException.class,
     87                () -> new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null));
    8788    }
    8889}
Note: See TracChangeset for help on using the changeset viewer.