Skip to content

Support void class lookups in ReflectionUtils #4048

@bjmi

Description

@bjmi

Running following parametrized test in JUnit 5.11

@ValueSource(strings = {
    "void", "boolean", "byte", "char", "short", "int", "long", "float", "double" })
@ParameterizedTest
void isPrimitive(Class<?> candidate) {
    assertTrue(candidate.isPrimitive());
}

only makes the "void" case fail.

org.junit.jupiter.api.extension.ParameterResolutionException:
    Error converting parameter at index 0: Failed to convert String "void" to type java.lang.Class

It looks like conversion of "void" to Class isn't supported.
Both classNameToTypeMap and primitiveToWrapperMap of org.junit.platform.commons.util.ReflectionUtils are lacking void.class and Void.class, but maybe this is by intention.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions