use of org.mockito.internal.matchers.LocalizedMatcher in project mockito by mockito.
the class MatchersBinder method bindMatchers.
public InvocationMatcher bindMatchers(ArgumentMatcherStorage argumentMatcherStorage, Invocation invocation) {
List<LocalizedMatcher> lastMatchers = argumentMatcherStorage.pullLocalizedMatchers();
validateMatchers(invocation, lastMatchers);
List<ArgumentMatcher> matchers = new LinkedList<ArgumentMatcher>();
for (LocalizedMatcher m : lastMatchers) {
matchers.add(m.getMatcher());
}
return new InvocationMatcher(invocation, matchers);
}
use of org.mockito.internal.matchers.LocalizedMatcher in project powermock by powermock.
the class PowerMockMatchersBinder method bindMatchers.
public InvocationMatcher bindMatchers(ArgumentMatcherStorage argumentMatcherStorage, final Invocation invocation) {
List<LocalizedMatcher> lastMatchers = argumentMatcherStorage.pullLocalizedMatchers();
validateMatchers(invocation, lastMatchers);
// In Mockito 2.0 LocalizedMatcher no more extend ArgumentMatcher, so new list should be created.
final List<ArgumentMatcher> argumentMatchers = extractArgumentMatchers(lastMatchers);
final InvocationMatcher invocationWithMatchers = new InvocationMatcher(invocation, argumentMatchers) {
@Override
public String toString() {
return invocation.toString();
}
};
return invocationWithMatchers;
}
Aggregations