[ https://issues.apache.org/jira/browse/SPARK-44314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yang Jie reassigned SPARK-44314: -------------------------------- Assignee: Yang Jie > 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 > Assignee: 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: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org