-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error msg for non-static external @MethodSource factory methods
Prior to this commit, the error message was cryptic if an external factory method was non-static and the test class was configured to run with test instance per-class lifecycle semantics. Specifically, the error was the following from the native implementation of Method#invoke in the JDK. java.lang.IllegalArgumentException: object is not an instance of declaring class This commit builds on the work done in PR #3263 by expanding the "static is required" check to any resolved factory method that cannot be invoked on the current test instance (which may be null). Consequently, the isPerMethodLifecycle() check is no longer necessary. Closes #3276
- Loading branch information
Showing
2 changed files
with
48 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters