JUnitParams icon indicating copy to clipboard operation
JUnitParams copied to clipboard

Fix tests with junit 4.13

Open jamesjer opened this issue 2 years ago • 0 comments
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 BigDecimal values from strings. The BigDecimal constructor is limited. This commit uses DecimalFormat for more sophisticated parsing of strings, fixing a handful of tests in the process.
  • The second commit fixes FilterableTest. The SingleMethodFilter class is no longer necessary, since junit provides Request.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, so request.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 hasMessage to hasMessageContaining since 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.

jamesjer avatar Nov 04 '23 01:11 jamesjer