JUnitParams
JUnitParams copied to clipboard
Fix tests with junit 4.13
trafficstars
This PR is a follow-on to https://github.com/Pragmatists/JUnitParams/pull/166 that fixes https://github.com/Pragmatists/JUnitParams/issues/172. It consists of 3 commits:
- The first commit beefs up the parsing of
BigDecimalvalues from strings. TheBigDecimalconstructor is limited. This commit usesDecimalFormatfor more sophisticated parsing of strings, fixing a handful of tests in the process. - The second commit fixes
FilterableTest. TheSingleMethodFilterclass is no longer necessary, since junit providesRequest.method. However, there is also a behavior change here:request.getRunner().getDescription()gets descriptions for all test methods, whether they pass the filter or not. They are marked appropriately, sorequest.getRunner().testCount()returns the expected value of 1 in each case, and if you actually run the tests, only 1 is executed. - The third commit changes two uses of
hasMessagetohasMessageContainingsince junit now returns a numbered list of exception strings.
With these changes, all tests pass. Some are noisy; I have not attempted to silence them.