This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-cli.git
The following commit(s) were added to refs/heads/master by this push:
new b8a6b20 Add missing test
b8a6b20 is described below
commit b8a6b209a468c16131fac03d0d7352338de30c0a
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Apr 7 13:26:25 2024 -0400
Add missing test
---
src/test/java/org/apache/commons/cli/TypeHandlerTest.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/test/java/org/apache/commons/cli/TypeHandlerTest.java
b/src/test/java/org/apache/commons/cli/TypeHandlerTest.java
index cac9497..cf7bf2c 100644
--- a/src/test/java/org/apache/commons/cli/TypeHandlerTest.java
+++ b/src/test/java/org/apache/commons/cli/TypeHandlerTest.java
@@ -174,10 +174,16 @@ public class TypeHandlerTest {
@ParameterizedTest(name = "{0} as {1}")
@MethodSource("createValueTestParameters")
public void createValueTests(final String str, final Class<?> type, final
Object expected) throws Exception {
+ @SuppressWarnings("cast")
+ final Object objectApiTest = (Object) type; // KEEP this cast
if (expected instanceof Class<?> &&
Throwable.class.isAssignableFrom((Class<?>) expected)) {
assertThrows((Class<Throwable>) expected, () ->
TypeHandler.createValue(str, type));
+ assertThrows((Class<Throwable>) expected, () -> {
+ TypeHandler.createValue(str, objectApiTest);
+ });
} else {
assertEquals(expected, TypeHandler.createValue(str, type));
+ assertEquals(expected, TypeHandler.createValue(str, objectApiTest);
}
}