Java Code Examples for org.mockito.invocation.Invocation#getArguments()
The following examples show how to use
org.mockito.invocation.Invocation#getArguments() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MockitoUtils.java From spring-analysis-note with MIT License | 5 votes |
private static Object[] getInvocationArguments(Invocation invocation, InvocationArgumentsAdapter... argumentAdapters) { Object[] arguments = invocation.getArguments(); for (InvocationArgumentsAdapter adapter : argumentAdapters) { arguments = adapter.adaptArguments(arguments); } return arguments; }
Example 2
Source File: MockitoUtils.java From java-technology-stack with MIT License | 5 votes |
private static Object[] getInvocationArguments(Invocation invocation, InvocationArgumentsAdapter... argumentAdapters) { Object[] arguments = invocation.getArguments(); for (InvocationArgumentsAdapter adapter : argumentAdapters) { arguments = adapter.adaptArguments(arguments); } return arguments; }
Example 3
Source File: MockitoUtils.java From spring4-understanding with Apache License 2.0 | 5 votes |
private static Object[] getInvocationArguments(Invocation invocation, InvocationArgumentsAdapter... argumentAdapters) { Object[] arguments = invocation.getArguments(); for (InvocationArgumentsAdapter adapter : argumentAdapters) { arguments = adapter.adaptArguments(arguments); } return arguments; }
Example 4
Source File: MatchersBinder.java From astor with GNU General Public License v2.0 | 5 votes |
private void validateMatchers(Invocation invocation, List<LocalizedMatcher> lastMatchers) { if (!lastMatchers.isEmpty()) { int recordedMatchersSize = lastMatchers.size(); int expectedMatchersSize = invocation.getArguments().length; if (expectedMatchersSize != recordedMatchersSize) { new Reporter().invalidUseOfMatchers(expectedMatchersSize, lastMatchers); } } }
Example 5
Source File: ArgumentsExtractorVerifier.java From yangtools with Eclipse Public License 1.0 | 5 votes |
@Override public void verify(final VerificationData data) { List<Invocation> actualInvocations = InvocationsFinder.findInvocations(data.getAllInvocations(), data.getTarget()); if (actualInvocations.size() != 1) { throw new MockitoException("This verifier can only be used with 1 invocation, got " + actualInvocations.size()); } Invocation invocation = actualInvocations.get(0); arguments = invocation.getArguments(); invocation.markVerified(); }
Example 6
Source File: ArgumentsComparator.java From astor with GNU General Public License v2.0 | 4 votes |
public boolean argumentsMatch(InvocationMatcher invocationMatcher, Invocation actual) { Object[] actualArgs = actual.getArguments(); return argumentsMatch(invocationMatcher, actualArgs) || varArgsMatch(invocationMatcher, actual); }