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

Migrate Hamcrest to JUnit 5 #343

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Commits on May 22, 2023

  1. WIP: Add recipe for migration from Hamcrest

    Work in progress implementation of a recipe which migrates Hamcrest test matchers to JUnit5 test assertions.
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed May 22, 2023
    Configuration menu
    Copy the full SHA
    4b2e427 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e8ffbae View commit details
    Browse the repository at this point in the history

Commits on May 23, 2023

  1. Configuration menu
    Copy the full SHA
    0bb2ffa View commit details
    Browse the repository at this point in the history
  2. Add missing license headers

    timtebeek committed May 23, 2023
    Configuration menu
    Copy the full SHA
    0947005 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    11d9fd2 View commit details
    Browse the repository at this point in the history
  4. Fix test import

    timtebeek committed May 23, 2023
    Configuration menu
    Copy the full SHA
    cc4a929 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2023

  1. Add proto implementation for assertEquals

    Added a prototype-y implementation of translation from hamcrest's equalTo to JUnit5's assertEquals. Should be easy to add more of the simple hamcrest matchers to this implementation.
    
    \TODO the import is not being added
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed May 24, 2023
    Configuration menu
    Copy the full SHA
    bc1d5c8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e17fc29 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2023

  1. Configuration menu
    Copy the full SHA
    76724ca View commit details
    Browse the repository at this point in the history
  2. Adapt to main

    Another iteration of the prototype. Adapted it to be
    based on the up-to-date main.
    Added a proposal of how similar simple matchers could be
    translated to junit assertion methods.
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    e360972 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2023

  1. Add more simple matcher-to-method translations

    Added translations for matchers closeTo, containsString, empty, emptyArray, emptyIterable, emptyCollectionOf, emptyIterableOf, endsWith.
    Tests need to be added for each matcher.
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    66473e8 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2023

  1. Add more simple matcher-to-method translations

    Added all the simple matcher-to-method translations.
    Tests need to be added for each matcher.
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    cc581eb View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2023

  1. Add tests

    Added a bunch of tests, to verify the correctness of each matcher-to-assertion case.
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    0eb3887 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2023

  1. Finalise the pull request

    Added all the necessary unit tests and polished out the implementation.
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    7d11579 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1730fbf View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2023

  1. Configuration menu
    Copy the full SHA
    3525302 View commit details
    Browse the repository at this point in the history
  2. Add required license header

    timtebeek committed Jun 30, 2023
    Configuration menu
    Copy the full SHA
    9357f7a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9e23d71 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d75e50f View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2023

  1. Refactored and split HamcrestMatcherToJUnit5 recipe

    Refactored HamcrestMatcherToJUnit5 recipe, so now the whole translation is stored in one place, not scatter amongst three methods. Given the existence of RemoveIsMatcher Recipe, this recipe relies that it will never encounter is() matcher.
    In similar fashion as RemoveIsMatcher, RemoveNotMatcher was added, which does exactly the same as RemoveIsMatcher, but it also stores the logical context for the nested matcher (so that it knows it was negated) in execution context.
    Matchers instanceOf and isA were difficult to handle within the HamcrestMatcherToJUnit5 recipe, therefore these cases were moved to a newly added HamcrestInstanceOfToJUnit5 recipe.
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    21d4728 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5395d63 View commit details
    Browse the repository at this point in the history
  3. Add license headers

    Forgot, added now
    
    Signed-off-by: matus.matok <[email protected]>
    matusmatokpt committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    ff0e775 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Configuration menu
    Copy the full SHA
    483fcb4 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2024

  1. Configuration menu
    Copy the full SHA
    26a8646 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2024

  1. Apply suggestions from code review

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    timtebeek and github-actions[bot] committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    93448e3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    be54077 View commit details
    Browse the repository at this point in the history
  3. Apply suggestions from code review

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    timtebeek and github-actions[bot] committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    be57cfe View commit details
    Browse the repository at this point in the history