[
https://issues.apache.org/jira/browse/SPARK-44314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17740386#comment-17740386
]
Snoot.io commented on SPARK-44314:
----------------------------------
User 'LuciferYang' has created a pull request for this issue:
https://github.com/apache/spark/pull/41872
> Add a new checkstyle rule to prohibit the use of `@Test(expected =
> SomeException.class)`
> ----------------------------------------------------------------------------------------
>
> Key: SPARK-44314
> URL: https://issues.apache.org/jira/browse/SPARK-44314
> Project: Spark
> Issue Type: Improvement
> Components: Build
> Affects Versions: 3.5.0
> Reporter: Yang Jie
> Priority: Minor
>
> [https://github.com/junit-team/junit4/wiki/Exception-testing]
>
> {code:java}
> The expected parameter should be used with care. The above test will pass if
> any code in the method throws IndexOutOfBoundsException. Using the method you
> also cannot test the value of the message in the exception, or the state of a
> domain object after the exception has been thrown.For these reasons, the
> previous approaches are recommended. {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]