Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't convert "void" to Class #4048

Open
bjmi opened this issue Oct 5, 2024 · 0 comments
Open

Can't convert "void" to Class #4048

bjmi opened this issue Oct 5, 2024 · 0 comments

Comments

@bjmi
Copy link
Contributor

bjmi commented Oct 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant