Changeset 18735 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2023-05-24T19:32:35+02:00 (18 months ago)
Author:
taylor.smock
Message:

Fix #22921: DateTimeException when using invalid day of month for overpass query

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java

    r17987 r18735  
    1717import java.util.concurrent.ForkJoinPool;
    1818
     19import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     20import net.trajano.commons.testing.UtilityClassTestUtil;
    1921import org.junit.jupiter.api.Disabled;
    2022import org.junit.jupiter.api.Test;
    2123import org.junit.jupiter.api.extension.RegisterExtension;
     24import org.junit.jupiter.params.ParameterizedTest;
     25import org.junit.jupiter.params.provider.ValueSource;
    2226import org.openstreetmap.josm.testutils.JOSMTestRules;
    2327import org.openstreetmap.josm.tools.UncheckedParseException;
    24 
    25 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    26 import net.trajano.commons.testing.UtilityClassTestUtil;
    2728
    2829/**
     
    116117     * Verifies that parsing an illegal date throws a {@link UncheckedParseException}
    117118     */
    118     @Test
    119     void testIllegalDate() {
    120         assertThrows(UncheckedParseException.class, () -> DateUtils.fromString("2014-"));
     119    @ParameterizedTest
     120    @ValueSource(strings = {"2014-", "2014-01-", "2014-01-01T", "2014-00-01", "2014-01-00"})
     121    void testIllegalDate(String date) {
     122        assertThrows(UncheckedParseException.class, () -> DateUtils.fromString(date));
    121123    }
    122124
Note: See TracChangeset for help on using the changeset viewer.