Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see Mockito class for for usage.
|
org.mockito.exceptions |
Exception messages, exception hierarchies.
|
org.mockito.internal |
Internal classes, not to be used by clients.
|
org.mockito.internal.debugging |
Whatever helps in debugging failed tests
|
org.mockito.internal.invocation |
Invocation and related classes.
|
org.mockito.internal.invocation.finder | |
org.mockito.internal.listeners | |
org.mockito.internal.progress |
Mocking progress stateful classes.
|
org.mockito.internal.reporting |
Deals with nicely printing verification errors
|
org.mockito.internal.stubbing |
Stubbing logic.
|
org.mockito.internal.stubbing.answers |
Answers for stubbed calls
|
org.mockito.internal.util |
Static utils
|
org.mockito.internal.verification |
Verification logic.
|
org.mockito.internal.verification.api |
This package should be open to public once verification API is fully finished
|
org.mockito.internal.verification.checkers |
verification checkers
|
org.mockito.invocation |
Public API related to invocation
|
Modifier and Type | Method and Description |
---|---|
Collection<Invocation> |
MockingDetails.getInvocations()
Provides a collection of methods indicating the invocations of the object
|
Modifier and Type | Method and Description |
---|---|
static MockitoAssertionError |
Reporter.noMoreInteractionsWanted(Invocation undesired,
List<VerificationAwareInvocation> invocations) |
static MockitoAssertionError |
Reporter.noMoreInteractionsWantedInOrder(Invocation undesired) |
Modifier and Type | Method and Description |
---|---|
Invocation |
MockitoCore.getLastInvocation()
For testing purposes only.
|
Modifier and Type | Method and Description |
---|---|
boolean |
InOrderImpl.isVerified(Invocation i) |
void |
InOrderImpl.markVerified(Invocation i) |
Modifier and Type | Method and Description |
---|---|
void |
FindingsListener.foundStubCalledWithDifferentArgs(Invocation unused,
InvocationMatcher unstubbed) |
void |
LoggingListener.foundStubCalledWithDifferentArgs(Invocation unused,
InvocationMatcher unstubbed) |
void |
FindingsListener.foundUnusedStub(Invocation unused) |
void |
LoggingListener.foundUnusedStub(Invocation unused) |
Constructor and Description |
---|
WarningsFinder(List<Invocation> unusedStubs,
List<InvocationMatcher> allInvocations) |
WarningsPrinterImpl(List<Invocation> unusedStubs,
List<InvocationMatcher> allInvocations,
boolean warnAboutUnstubbed) |
Modifier and Type | Class and Description |
---|---|
class |
InvocationImpl
Method call on a mock object.
|
Modifier and Type | Method and Description |
---|---|
Invocation |
InvocationsFinder.findFirstMatchingUnverifiedInvocation(List<Invocation> invocations,
InvocationMatcher wanted,
InOrderContext context) |
Invocation |
InvocationsFinder.findFirstUnverified(List<Invocation> invocations) |
Invocation |
InvocationsFinder.findFirstUnverifiedInOrder(InOrderContext context,
List<Invocation> orderedInvocations)
i3 is unverified here:
i1, i2, i3
v
all good here:
i1, i2, i3
v v
|
Invocation |
InvocationsFinder.findPreviousVerifiedInOrder(List<Invocation> invocations,
InOrderContext context) |
Invocation |
InvocationsFinder.findSimilarInvocation(List<Invocation> invocations,
InvocationMatcher wanted) |
Invocation |
InvocationMatcher.getInvocation() |
Modifier and Type | Method and Description |
---|---|
List<Invocation> |
UnusedStubsFinder.find(List<?> mocks)
Finds all unused stubs for given mocks
|
List<Invocation> |
InvocationsFinder.findAllMatchingUnverifiedChunks(List<Invocation> invocations,
InvocationMatcher wanted,
InOrderContext orderingContext) |
List<Invocation> |
InvocationsFinder.findInvocations(List<Invocation> invocations,
InvocationMatcher wanted) |
List<Invocation> |
InvocationsFinder.findMatchingChunk(List<Invocation> invocations,
InvocationMatcher wanted,
int wantedCount,
InOrderContext context)
some examples how it works:
Given invocations sequence:
1,1,2,1
if wanted is 1 and mode is times(2) then returns
1,1
if wanted is 1 and mode is atLeast() then returns
1,1,1
if wanted is 1 and mode is times(x), where x != 2 then returns
1,1,1
|
Modifier and Type | Method and Description |
---|---|
boolean |
ArgumentsComparator.argumentsMatch(InvocationMatcher invocationMatcher,
Invocation actual) |
InvocationMatcher |
MatchersBinder.bindMatchers(ArgumentMatcherStorage argumentMatcherStorage,
Invocation invocation) |
void |
CapturesArgumentsFromInvocation.captureArgumentsFrom(Invocation i) |
void |
InvocationMatcher.captureArgumentsFrom(Invocation invocation) |
boolean |
InvocationMatcher.hasSameMethod(Invocation candidate) |
boolean |
InvocationMatcher.hasSimilarMethod(Invocation candidate)
similar means the same method name, same mock, unverified
and: if arguments are the same cannot be overloaded
|
static void |
InvocationMarker.markVerified(Invocation invocation,
CapturesArgumentsFromInvocation wanted) |
boolean |
InvocationMatcher.matches(Invocation actual) |
Modifier and Type | Method and Description |
---|---|
static List<InvocationMatcher> |
InvocationMatcher.createFrom(List<Invocation> invocations) |
List<Invocation> |
InvocationsFinder.findAllMatchingUnverifiedChunks(List<Invocation> invocations,
InvocationMatcher wanted,
InOrderContext orderingContext) |
Invocation |
InvocationsFinder.findFirstMatchingUnverifiedInvocation(List<Invocation> invocations,
InvocationMatcher wanted,
InOrderContext context) |
Invocation |
InvocationsFinder.findFirstUnverified(List<Invocation> invocations) |
Invocation |
InvocationsFinder.findFirstUnverifiedInOrder(InOrderContext context,
List<Invocation> orderedInvocations)
i3 is unverified here:
i1, i2, i3
v
all good here:
i1, i2, i3
v v
|
List<Invocation> |
InvocationsFinder.findInvocations(List<Invocation> invocations,
InvocationMatcher wanted) |
List<Invocation> |
InvocationsFinder.findMatchingChunk(List<Invocation> invocations,
InvocationMatcher wanted,
int wantedCount,
InOrderContext context)
some examples how it works:
Given invocations sequence:
1,1,2,1
if wanted is 1 and mode is times(2) then returns
1,1
if wanted is 1 and mode is atLeast() then returns
1,1,1
if wanted is 1 and mode is times(x), where x != 2 then returns
1,1,1
|
Invocation |
InvocationsFinder.findPreviousVerifiedInOrder(List<Invocation> invocations,
InOrderContext context) |
Invocation |
InvocationsFinder.findSimilarInvocation(List<Invocation> invocations,
InvocationMatcher wanted) |
Location |
InvocationsFinder.getLastLocation(List<Invocation> invocations) |
static void |
InvocationMarker.markVerified(List<Invocation> invocations,
CapturesArgumentsFromInvocation wanted) |
static void |
InvocationMarker.markVerifiedInOrder(List<Invocation> chunk,
CapturesArgumentsFromInvocation wanted,
InOrderContext context) |
Constructor and Description |
---|
InvocationMatcher(Invocation invocation) |
InvocationMatcher(Invocation invocation,
List<ArgumentMatcher> matchers) |
Modifier and Type | Method and Description |
---|---|
List<Invocation> |
VerifiableInvocationsFinder.find(List<?> mocks) |
List<Invocation> |
AllInvocationsFinder.find(List<?> mocks)
gets all invocations from mocks.
|
Constructor and Description |
---|
NotifiedMethodInvocationReport(Invocation invocation,
Object returnedValue)
Build a new
MethodInvocationReport with a return value. |
NotifiedMethodInvocationReport(Invocation invocation,
Throwable throwable)
Build a new
MethodInvocationReport with a return value. |
Modifier and Type | Method and Description |
---|---|
void |
MockingProgressImpl.stubbingCompleted(Invocation invocation) |
void |
ThreadSafeMockingProgress.stubbingCompleted(Invocation invocation) |
void |
MockingProgress.stubbingCompleted(Invocation invocation) |
Modifier and Type | Method and Description |
---|---|
String |
PrintSettings.print(Invocation invocation) |
String |
PrintSettings.print(List<ArgumentMatcher> matchers,
Invocation invocation) |
Constructor and Description |
---|
SmartPrinter(InvocationMatcher wanted,
Invocation actual,
Integer... indexesOfMatchersToBeDescribedWithExtraTypeInfo) |
Modifier and Type | Method and Description |
---|---|
List<Invocation> |
InvocationContainer.getInvocations() |
List<Invocation> |
InvocationContainerImpl.getInvocations() |
List<Invocation> |
OngoingStubbingImpl.getRegisteredInvocations() |
Modifier and Type | Method and Description |
---|---|
StubbedInvocationMatcher |
InvocationContainerImpl.findAnswerFor(Invocation invocation) |
Modifier and Type | Method and Description |
---|---|
void |
AnswersValidator.validate(Answer<?> answer,
Invocation invocation) |
void |
AnswersValidator.validateDefaultAnswerReturnedValue(Invocation invocation,
Object returnedValue) |
Constructor and Description |
---|
MethodInfo(Invocation theInvocation) |
Modifier and Type | Method and Description |
---|---|
Collection<Invocation> |
DefaultMockingDetails.getInvocations() |
Modifier and Type | Method and Description |
---|---|
List<Invocation> |
DefaultRegisteredInvocations.getAll() |
List<Invocation> |
RegisteredInvocations.getAll() |
List<Invocation> |
SingleRegisteredInvocation.getAll() |
List<Invocation> |
VerificationDataImpl.getAllInvocations() |
Modifier and Type | Method and Description |
---|---|
void |
DefaultRegisteredInvocations.add(Invocation invocation) |
void |
RegisteredInvocations.add(Invocation invocation) |
void |
SingleRegisteredInvocation.add(Invocation invocation) |
boolean |
InOrderContextImpl.isVerified(Invocation invocation) |
void |
InOrderContextImpl.markVerified(Invocation i) |
Modifier and Type | Method and Description |
---|---|
List<Invocation> |
VerificationDataInOrder.getAllInvocations() |
List<Invocation> |
VerificationDataInOrderImpl.getAllInvocations() |
List<Invocation> |
VerificationData.getAllInvocations() |
Modifier and Type | Method and Description |
---|---|
boolean |
InOrderContext.isVerified(Invocation invocation) |
void |
InOrderContext.markVerified(Invocation i) |
Constructor and Description |
---|
VerificationDataInOrderImpl(InOrderContext inOrder,
List<Invocation> allInvocations,
InvocationMatcher wanted) |
Modifier and Type | Method and Description |
---|---|
void |
MissingInvocationChecker.check(List<Invocation> invocations,
InvocationMatcher wanted) |
void |
AtLeastXNumberOfInvocationsChecker.check(List<Invocation> invocations,
InvocationMatcher wanted,
int wantedCount) |
void |
AtLeastXNumberOfInvocationsInOrderChecker.check(List<Invocation> invocations,
InvocationMatcher wanted,
int wantedCount) |
void |
NumberOfInvocationsChecker.check(List<Invocation> invocations,
InvocationMatcher wanted,
int wantedCount) |
void |
NonGreedyNumberOfInvocationsInOrderChecker.check(List<Invocation> invocations,
InvocationMatcher wanted,
int wantedCount,
InOrderContext context) |
void |
NumberOfInvocationsInOrderChecker.check(List<Invocation> invocations,
InvocationMatcher wanted,
int wantedCount,
InOrderContext context) |
void |
MissingInvocationInOrderChecker.check(List<Invocation> invocations,
InvocationMatcher wanted,
VerificationMode mode,
InOrderContext context) |
Modifier and Type | Method and Description |
---|---|
Object |
MockHandler.handle(Invocation invocation)
Takes an invocation object and handles it.
|