Ignore:
Timestamp:
2020-06-14T11:54:13+02:00 (4 years ago)
Author:
simon04
Message:

see #16567 - Fix deprecations related to JUnit 5 (patch by taylor.smock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java

    r16582 r16618  
    66import static org.junit.Assert.assertNotNull;
    77import static org.junit.Assert.assertTrue;
     8import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
     9import static org.junit.jupiter.api.Assertions.assertThrows;
    810
    911import java.lang.reflect.Field;
     
    1921import org.junit.Rule;
    2022import org.junit.Test;
    21 import org.junit.rules.ExpectedException;
    2223import org.openstreetmap.josm.TestUtils;
    2324import org.openstreetmap.josm.data.coor.LatLon;
     
    6162    public JOSMTestRules test = new JOSMTestRules().preferences().timeout(30000);
    6263
    63     /**
    64      * Rule to assert exception message.
    65      */
    66     @Rule
    67     public ExpectedException expectedEx = ExpectedException.none();
    68 
    6964    private static final class SearchContext {
    7065        final DataSet ds = new DataSet();
     
    427422    @Test
    428423    public void testFooTypeBar() throws SearchParseError {
    429         expectedEx.expect(SearchParseError.class);
    430         expectedEx.expectMessage("<html>Expecting <code>:</code> after <i>type</i></html>");
    431         SearchCompiler.compile("foo type bar");
     424        Exception e = assertThrows(SearchParseError.class, () -> SearchCompiler.compile("foo type bar"));
     425        assertEquals("<html>Expecting <code>:</code> after <i>type</i></html>", e.getMessage());
    432426    }
    433427
     
    553547    @Test
    554548    public void testEnumExactKeyValueMode() {
    555         TestUtils.superficialEnumCodeCoverage(ExactKeyValue.Mode.class);
     549        assertDoesNotThrow(() -> TestUtils.superficialEnumCodeCoverage(ExactKeyValue.Mode.class));
    556550    }
    557551
Note: See TracChangeset for help on using the changeset viewer.