CE-1955 Update getValueAsInstant to handle a single-digit hour, by assuming a leading 0 on it.

This commit is contained in:
2025-01-10 16:11:14 -06:00
parent 70b569c2ca
commit e2c7748a4b
2 changed files with 51 additions and 14 deletions

View File

@ -251,6 +251,9 @@ class ValueUtilsTest extends BaseTest
assertThrows(QValueException.class, () -> ValueUtils.getValueAsInstant("a,b"));
assertThrows(QValueException.class, () -> ValueUtils.getValueAsInstant("1980/05/31"));
assertThat(assertThrows(QValueException.class, () -> ValueUtils.getValueAsInstant(new Object())).getMessage()).contains("Unsupported class");
expected = Instant.parse("1980-05-31T01:30:00Z");
assertEquals(expected, ValueUtils.getValueAsInstant("1980-05-31 1:30:00"));
}