Skip to content

Why are test methods restricted to the void type? #4563

Answered by sbrannen
rlagyu0 asked this question in Q&A
Discussion options

You must be logged in to vote

The rationale is that it is likely an error if a @Test method returns something, since the testing framework will never make use of such a return value.

For background see:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rlagyu0
Comment options

Answer selected by sormuras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants