Closed hprange closed 11 years ago
The new TestRule is incompatible with the old MethodRule. There is a bug report for this https://github.com/KentBeck/junit/issues/351.
The MethodRule
class is not deprecated anymore as of JUnit 4.11. See https://github.com/junit-team/junit/blob/master/doc/ReleaseNotes4.11.md for more information.
Copied from JUnit 4.9 release notes:
In JUnit 4.9, fields that can be annotated with either
@Rule
or@ClassRule
should be of typeTestRule
. The oldMethodRule
type, which only made sense for method-level rules, will still work, but is deprecated.Most built-in Rules have been moved to the new type already, in a way that should be transparent to most users.
TestWatchman
has been deprecated, and replaced byTestWatcher
, which has the same functionality, but implements the new type.