Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resource path URL decoding in tx validator tests and clean similar tests #7025

Commits on Feb 2, 2024

  1. Use Paths.get(URI) instead of Path.of(String) to fetch test resource

    Fix resource loading in 'MakerTxValidatorSanityCheckTests', which breaks
    when the working directory has spaces in its absolute path, due to the
    fact that the test resource paths are URL encoded.
    
    (This pattern is already used to load resources in a few other tests, so
    there hopefully won't be a regression on Windows.)
    stejbac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    1e33209 View commit details
    Browse the repository at this point in the history
  2. Clean up TxValidatorTest & resource loading in other tests

    Fix inspection warnings and other minor defects (unchecked casts, bad
    'assert*' usage, unused assignments/declarations, missing null checks,
    object equality on enum instances, needless statement lambdas, missing
    final, redundant 'toString', needless visibility) in 'TxValidatorTest'.
    
    Also, uniformise and slightly tidy resource loading in other test
    classes, replacing 'Files.readAllBytes' with Java 11 'Files.readString'
    (which assumes UTF-8 as desired, instead of the default charset).
    stejbac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    c41903f View commit details
    Browse the repository at this point in the history
  3. Replace MockitoSession with the Mockito test extension

    Now that 'mockito-junit-jupiter' has been added to the build test
    dependencies, we may replace the manual setup & tear down of a Mockito
    session with the 'MockitoExtension' JUnit 5 test extension, as the old
    Mockito JUnit 4 test runner was no longer available upon upgrading to
    Jupiter. This slightly simplifies the tests which use '@mock', '@SPY',
    etc.
    stejbac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    99f639a View commit details
    Browse the repository at this point in the history