File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,10 +174,16 @@ private static Stream<Arguments> createValueTestParameters() {
174174 @ ParameterizedTest (name = "{0} as {1}" )
175175 @ MethodSource ("createValueTestParameters" )
176176 public void createValueTests (final String str , final Class <?> type , final Object expected ) throws Exception {
177+ @ SuppressWarnings ("cast" )
178+ final Object objectApiTest = (Object ) type ; // KEEP this cast
177179 if (expected instanceof Class <?> && Throwable .class .isAssignableFrom ((Class <?>) expected )) {
178180 assertThrows ((Class <Throwable >) expected , () -> TypeHandler .createValue (str , type ));
181+ assertThrows ((Class <Throwable >) expected , () -> {
182+ TypeHandler .createValue (str , objectApiTest );
183+ });
179184 } else {
180185 assertEquals (expected , TypeHandler .createValue (str , type ));
186+ assertEquals (expected , TypeHandler .createValue (str , objectApiTest );
181187 }
182188 }
183189
You can’t perform that action at this time.
0 commit comments