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

Remove VarargMatcher #2835

Merged
merged 14 commits into from
Dec 30, 2022
Merged

Commits on Dec 23, 2022

  1. Remove VarargMatcher

    fixes: mockito#1593
    
    Remove broken `VarargMatcher` internal interface.
    
    BREAKING CHANGE: This changes the default behaviour of the `any()` matcher when passed to a varargs parameter.  Previously, the `any()` matcher would match each element in the varargs parameter, matching any number of elements 0...n. From Mockito v5 onwards `any()`, when passed to a varargs parameter, will match invocations where a single value is passed to the varargs parameter. To match any number of values passed to the varargs parameter, pass the type of the varargs parameter to `any()`. For example, given a `String...` varargs parameter, use `any(String[].class)`.
    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    04b4581 View commit details
    Browse the repository at this point in the history
  2. Remove duplicate test file

    ...tests duplicate others in `VarargsTest`
    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    7fe9688 View commit details
    Browse the repository at this point in the history
  3. InstanceOf

    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    c6eb9e6 View commit details
    Browse the repository at this point in the history
  4. CapturingMatcher

    BREAKING CHANGE: The behaviour of argument captors when passed to a varargs parameter has changed. Prior to Mockito v5, passing an argument captor to a varargs parameter would capture any number of values passed to the varargs parameter. From Mockito v5, the same call will match only a single value passed to the varargs parameter.  To capture any number of values, change to the type of the argument captor to match the array type of the varargs parameter. For example, given a `String...` varargs parameter, change the argument captor from type `String` to type `String[]`.
    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    8285f9c View commit details
    Browse the repository at this point in the history
  5. CapturingMatcher part II

    ... fix tests!
    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    a1221dd View commit details
    Browse the repository at this point in the history
  6. CapturingMatcher part III

    ... fix tests!
    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    873294f View commit details
    Browse the repository at this point in the history
  7. HamcrestArgumentMatcher

    BREAKING CHANGE: The behaviour of all methods in `MockitoHamcrest` when passed to a varargs parameter has changed. Prior to Mockito v5, these matchers would match each element in the varargs parameter, matching any number of elements 0...n. From Mockito v5 onwards these matchers, when passed to a varargs parameter, will match invocations where a single value is passed to the varargs parameter. To match any number of values passed to the varargs parameter, pass use suitable Matcher that matches the vararg's array type. For example, given a `String...` varargs parameter, use a Matcher that handles `String[].class`.
    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    6572d0b View commit details
    Browse the repository at this point in the history
  8. Checkstyle

    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    2a13caf View commit details
    Browse the repository at this point in the history
  9. add argThat(matcher, type)

    ... required to support matchers that match a vararg parameter, rather than values in a varargs parameter.
    big-andy-coates committed Dec 23, 2022
    Configuration menu
    Copy the full SHA
    7117387 View commit details
    Browse the repository at this point in the history

Commits on Dec 24, 2022

  1. Configuration menu
    Copy the full SHA
    eaafc3e View commit details
    Browse the repository at this point in the history
  2. Remove VarargMatcher

    big-andy-coates committed Dec 24, 2022
    Configuration menu
    Copy the full SHA
    17f97a1 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2022

  1. Add primitive captor tests

    ...demonstrating how exactly two, or any number, of varargs values  can be matched with argument captors.
    big-andy-coates committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    fbf8929 View commit details
    Browse the repository at this point in the history
  2. Correct @SInCE

    ...for methods released in 4.11.0
    big-andy-coates committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    7a87dd6 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2022

  1. Merge from main

    big-andy-coates committed Dec 30, 2022
    Configuration menu
    Copy the full SHA
    b939591 View commit details
    Browse the repository at this point in the history