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

Fixes issue #1222 #1461

Closed
wants to merge 2 commits into from
Closed

Conversation

Alias-m
Copy link

@Alias-m Alias-m commented Jul 29, 2018

Simple vararg argument matcher

Fixes #1222

@codecov-io
Copy link

codecov-io commented Jul 29, 2018

Codecov Report

Merging #1461 into release/2.x will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                @@
##             release/2.x    #1461      +/-   ##
=================================================
+ Coverage          88.54%   88.56%   +0.01%     
- Complexity          2393     2398       +5     
=================================================
  Files                297      298       +1     
  Lines               6008     6018      +10     
  Branches             727      729       +2     
=================================================
+ Hits                5320     5330      +10     
  Misses               507      507              
  Partials             181      181
Impacted Files Coverage Δ Complexity Δ
...g/mockito/internal/matchers/VarargMatcherImpl.java 100% <100%> (ø) 5 <5> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 276183b...4765544. Read the comment docs.

@mockitoguy
Copy link
Member

Thank you for your contribution. The ticket suggests to add a new matcher method in the public API. In your PR, you added an internal class that is not a public API.

@Alias-m
Copy link
Author

Alias-m commented Jul 31, 2018

I could have add this method in the ArgumentMatchers class (which would have been a better solution), but I didn't want to change it because it has not been updated since last year

    public static <T> T vararg(T... value) {
        reportMatcher(new VarargMatcherImpl(value));
        if (value == null)
            return null;
        return (T) Primitives.defaultValue(value.getClass());
    }

@TimvdLippe
Copy link
Contributor

Closing this PR as stale. Feel free to open a new PR if you are still interested in landing these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot verify varargs parameter as an array
4 participants