Index

A B C D E F G H I J K L M N O P R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

C

0.2. Configuration-free inline mock making - Search tag in class org.mockito.Mockito
Section
14. Changing default return values of un-stubbed invocations (Since 1.7) - Search tag in class org.mockito.Mockito
Section
15. Capturing arguments for further assertions (Since 1.8.0) - Search tag in class org.mockito.Mockito
Section
35. Custom verification failure message (Since 2.1.0) - Search tag in class org.mockito.Mockito
Section
Cache() - Constructor for class org.mockito.plugins.DoNotMockEnforcer.Cache
 
call() - Method in interface org.mockito.invocation.InvocationFactory.RealMethodBehavior
 
callRealMethod() - Method in class org.mockito.internal.invocation.InterceptedInvocation
 
callRealMethod() - Method in interface org.mockito.invocation.InvocationOnMock
calls real method
calls(int) - Static method in class org.mockito.internal.verification.VerificationModeFactory
 
calls(int) - Static method in class org.mockito.Mockito
Allows non-greedy verification in order.
Calls - Class in org.mockito.internal.verification
 
Calls(int) - Constructor for class org.mockito.internal.verification.Calls
 
CALLS_REAL_METHODS - Enum constant in enum org.mockito.Answers
An answer that calls the real methods (used for partial mocks).
CALLS_REAL_METHODS - Static variable in class org.mockito.Mockito
Optional Answer to be used with Mockito.mock(Class, Answer)
CallsRealMethods - Class in org.mockito.internal.stubbing.answers
Optional Answer that adds partial mocking support
CallsRealMethods() - Constructor for class org.mockito.internal.stubbing.answers.CallsRealMethods
 
cannotCallAbstractRealMethod() - Static method in class org.mockito.internal.exceptions.Reporter
 
cannotCreateTimerWithNegativeDurationTime(long) - Static method in class org.mockito.internal.exceptions.Reporter
 
cannotInitializeForInjectMocksAnnotation(String, String) - Static method in class org.mockito.internal.exceptions.Reporter
 
cannotInitializeForSpyAnnotation(String, Exception) - Static method in class org.mockito.internal.exceptions.Reporter
 
cannotInjectDependency(Field, Object, Exception) - Static method in class org.mockito.internal.exceptions.Reporter
 
cannotMockClass(Class<?>, String) - Static method in class org.mockito.internal.exceptions.Reporter
 
cannotStubVoidMethodWithAReturnValue(String) - Static method in class org.mockito.internal.exceptions.Reporter
 
CannotStubVoidMethodWithReturnValue - Exception Class in org.mockito.exceptions.misusing
 
CannotStubVoidMethodWithReturnValue(String) - Constructor for exception class org.mockito.exceptions.misusing.CannotStubVoidMethodWithReturnValue
 
cannotStubWithNullThrowable() - Static method in class org.mockito.internal.exceptions.Reporter
 
CannotVerifyStubOnlyMock - Exception Class in org.mockito.exceptions.misusing
 
CannotVerifyStubOnlyMock(String) - Constructor for exception class org.mockito.exceptions.misusing.CannotVerifyStubOnlyMock
 
cannotVerifyToString() - Static method in class org.mockito.internal.exceptions.Reporter
 
canRecoverFromFailure(VerificationMode) - Method in class org.mockito.internal.verification.VerificationOverTimeImpl
 
captor(U...) - Static method in class org.mockito.ArgumentCaptor
Build a new ArgumentCaptor by inferring the class type.
Captor - Annotation Type in org.mockito
Allows shorthand ArgumentCaptor creation on fields.
CaptorAnnotationProcessor - Class in org.mockito.internal.configuration
Instantiate ArgumentCaptor a field annotated by @Captor.
CaptorAnnotationProcessor() - Constructor for class org.mockito.internal.configuration.CaptorAnnotationProcessor
 
capture() - Method in class org.mockito.ArgumentCaptor
Use it to capture the argument.
captureArgumentsFrom(Invocation) - Method in class org.mockito.internal.invocation.InvocationMatcher
 
captureArgumentsFrom(Invocation) - Method in interface org.mockito.invocation.MatchableInvocation
This method is used by Mockito to implement argument captor functionality (see ArgumentCaptor.
captureFrom(Object) - Method in interface org.mockito.internal.matchers.CapturesArguments
 
captureFrom(Object) - Method in class org.mockito.internal.matchers.CapturingMatcher
 
CapturesArguments - Interface in org.mockito.internal.matchers
 
CapturingMatcher<T> - Class in org.mockito.internal.matchers
 
CapturingMatcher(Class<? extends T>) - Constructor for class org.mockito.internal.matchers.CapturingMatcher
 
charThat(Matcher<Character>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
Enables integrating hamcrest matchers that match primitive char arguments.
charThat(ArgumentMatcher<Character>) - Static method in class org.mockito.ArgumentMatchers
Allows creating custom char argument matchers.
checkAtLeastNumberOfInvocations(List<Invocation>, MatchableInvocation, int) - Static method in class org.mockito.internal.verification.checkers.AtLeastXNumberOfInvocationsChecker
 
checkAtLeastNumberOfInvocations(List<Invocation>, MatchableInvocation, int, InOrderContext) - Static method in class org.mockito.internal.verification.checkers.AtLeastXNumberOfInvocationsChecker
 
checkedExceptionInvalid(Throwable) - Static method in class org.mockito.internal.exceptions.Reporter
 
checkItemsNotNull(T, String) - Static method in class org.mockito.internal.util.Checks
 
checkMissingInvocation(List<Invocation>, MatchableInvocation) - Static method in class org.mockito.internal.verification.checkers.MissingInvocationChecker
 
checkMissingInvocation(List<Invocation>, MatchableInvocation, InOrderContext) - Static method in class org.mockito.internal.verification.checkers.MissingInvocationChecker
 
checkNotNull(T, String) - Static method in class org.mockito.internal.util.Checks
 
checkNotNull(T, String, String) - Static method in class org.mockito.internal.util.Checks
 
checkNumberOfInvocations(List<Invocation>, MatchableInvocation, int) - Static method in class org.mockito.internal.verification.checkers.NumberOfInvocationsChecker
 
checkNumberOfInvocations(List<Invocation>, MatchableInvocation, int, InOrderContext) - Static method in class org.mockito.internal.verification.checkers.NumberOfInvocationsChecker
 
checkNumberOfInvocationsNonGreedy(List<Invocation>, MatchableInvocation, int, InOrderContext) - Static method in class org.mockito.internal.verification.checkers.NumberOfInvocationsChecker
 
CheckReturnValue - Annotation Type in org.mockito
This annotation is not supposed to be used by Mockito end-users.
Checks - Class in org.mockito.internal.util
Pre-made preconditions
checkTypeForDoNotMockViolation(Class<?>) - Method in class org.mockito.internal.configuration.DefaultDoNotMockEnforcer
 
checkTypeForDoNotMockViolation(Class<?>) - Method in interface org.mockito.plugins.DoNotMockEnforcer
Check whether this type is allowed to be mocked.
checkTypeForDoNotMockViolation(MockCreationSettings<?>) - Method in interface org.mockito.plugins.DoNotMockEnforcer
Check whether this type is allowed to be mocked.
checkTypeForDoNotMockViolation(MockCreationSettings<?>) - Method in interface org.mockito.plugins.DoNotMockEnforcerWithType
Check whether this type is allowed to be mocked.
ClassPathLoader - Class in org.mockito.internal.configuration
Loads configuration or extension points available in the classpath.
ClassPathLoader() - Constructor for class org.mockito.internal.configuration.ClassPathLoader
 
Cleaner tests without unnecessary stubs - Search tag in interface org.mockito.quality.MockitoHint
Section
cleansStackTrace() - Method in class org.mockito.configuration.DefaultMockitoConfiguration
 
cleansStackTrace() - Method in interface org.mockito.configuration.IMockitoConfiguration
This should be turned on unless you're a Mockito developer and you wish to have verbose (read: messy) stack traces that only few understand (eg: Mockito developers)
cleansStackTrace() - Method in class org.mockito.internal.configuration.GlobalConfiguration
 
clear() - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
 
clear() - Method in class org.mockito.internal.util.concurrent.DetachedThreadLocal
 
clear() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentMap
Clears the entire map.
clear() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentSet
Clears the set.
clear() - Method in class org.mockito.internal.verification.DefaultRegisteredInvocations
 
clear() - Method in interface org.mockito.internal.verification.RegisteredInvocations
 
clear() - Method in class org.mockito.internal.verification.SingleRegisteredInvocation
 
clearAll() - Method in class org.mockito.internal.util.concurrent.DetachedThreadLocal
Clears all thread local references for all threads.
clearAllCaches() - Method in class org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker
 
clearAllCaches() - Method in interface org.mockito.internal.creation.bytebuddy.BytecodeGenerator
 
clearAllCaches() - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
clearAllCaches() - Method in class org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator
 
clearAllCaches() - Method in class org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker
 
clearAllCaches() - Method in class org.mockito.internal.MockitoCore
 
clearAllCaches() - Static method in class org.mockito.internal.util.MockUtil
 
clearAllCaches() - Static method in class org.mockito.Mockito
Clears all mocks, type caches and instrumentations.
clearAllCaches() - Method in interface org.mockito.plugins.MockMaker
Clears all cashes for mocked types and removes all byte code alterations, if possible.
clearAllMocks() - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
clearAllMocks() - Method in interface org.mockito.plugins.InlineMockMaker
Cleans up internal state for all existing mocks.
clearInlineMock(Object) - Method in class org.mockito.internal.framework.DefaultMockitoFramework
 
clearInlineMock(Object) - Method in interface org.mockito.MockitoFramework
Clears up internal state of specific inline mock.
clearInlineMocks() - Method in class org.mockito.internal.framework.DefaultMockitoFramework
 
clearInlineMocks() - Method in interface org.mockito.MockitoFramework
Clears up internal state of all inline mocks.
clearInvocations() - Method in class org.mockito.internal.MockedStaticImpl
 
clearInvocations() - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
 
clearInvocations() - Method in interface org.mockito.MockedStatic
clearInvocations(T...) - Method in class org.mockito.internal.MockitoCore
 
clearInvocations(T...) - Static method in class org.mockito.Mockito
Use this method in order to only clear invocations, when stubbing is non-trivial.
clearListeners() - Method in interface org.mockito.internal.progress.MockingProgress
Removes all listeners added via MockingProgress.addListener(MockitoListener).
clearListeners() - Method in class org.mockito.internal.progress.MockingProgressImpl
 
clearMock(Object) - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
clearMock(Object) - Method in interface org.mockito.plugins.InlineMockMaker
Clean up internal state for specified mock.
clone() - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
 
ClonesArguments - Class in org.mockito.internal.stubbing.answers
 
ClonesArguments() - Constructor for class org.mockito.internal.stubbing.answers.ClonesArguments
 
close() - Method in class org.mockito.internal.MockedConstructionImpl
 
close() - Method in class org.mockito.internal.MockedStaticImpl
 
close() - Method in class org.mockito.plugins.AnnotationEngine.NoAction
 
close() - Method in interface org.mockito.ScopedMock
Closes this scoped mock and throws an exception if already closed.
close(Closeable) - Static method in class org.mockito.internal.util.io.IOUtil
Closes the target.
closeOnDemand() - Method in class org.mockito.internal.MockedConstructionImpl
 
closeOnDemand() - Method in class org.mockito.internal.MockedStaticImpl
 
closeOnDemand() - Method in interface org.mockito.ScopedMock
Releases this scoped mock and is non-operational if already released.
closeQuietly(Closeable) - Static method in class org.mockito.internal.util.io.IOUtil
Closes the target.
cmpEq(T) - Static method in class org.mockito.AdditionalMatchers
comparable argument equals to the given value according to their compareTo method.
collectAndReport() - Method in class org.mockito.internal.junit.VerificationCollectorImpl
 
collectAndReport() - Method in interface org.mockito.junit.VerificationCollector
Collect all lazily verified behaviour.
collector() - Static method in class org.mockito.junit.MockitoJUnit
Creates a rule instance that can perform lazy verifications.
compare(Invocation, Invocation) - Method in class org.mockito.internal.invocation.InvocationComparator
 
compare(Stubbing, Stubbing) - Method in class org.mockito.internal.stubbing.StubbingComparator
 
CompareEqual<T> - Class in org.mockito.internal.matchers
 
CompareEqual(T) - Constructor for class org.mockito.internal.matchers.CompareEqual
 
CompareTo<T> - Class in org.mockito.internal.matchers
 
CompareTo(T) - Constructor for class org.mockito.internal.matchers.CompareTo
 
ConditionalStackTraceFilter - Class in org.mockito.internal.exceptions.stacktrace
 
ConditionalStackTraceFilter() - Constructor for class org.mockito.internal.exceptions.stacktrace.ConditionalStackTraceFilter
 
ConsecutiveStubbing<T> - Class in org.mockito.internal.stubbing
 
ConsoleMockitoLogger - Class in org.mockito.internal.util
 
ConsoleMockitoLogger() - Constructor for class org.mockito.internal.util.ConsoleMockitoLogger
 
constructed() - Method in class org.mockito.internal.MockedConstructionImpl
 
constructed() - Method in interface org.mockito.MockedConstruction
Get the constructed mocks.
ConstructionCallback - Interface in org.mockito.internal.creation.bytebuddy
 
constructor() - Method in interface org.mockito.MockedConstruction.Context
Get the constructor that is invoked during the mock creation.
ConstructorInjection - Class in org.mockito.internal.configuration.injection
Injection strategy based on constructor.
ConstructorInjection() - Constructor for class org.mockito.internal.configuration.injection.ConstructorInjection
 
ConstructorInstantiator - Class in org.mockito.internal.creation.instance
 
ConstructorInstantiator(boolean, Object...) - Constructor for class org.mockito.internal.creation.instance.ConstructorInstantiator
 
contains(Object) - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
 
contains(Object) - Method in class org.mockito.internal.util.collections.IdentitySet
 
contains(String) - Static method in class org.mockito.ArgumentMatchers
String argument that contains the given substring.
contains(V) - Method in class org.mockito.internal.util.concurrent.WeakConcurrentSet
 
Contains - Class in org.mockito.internal.matchers
 
Contains(String) - Constructor for class org.mockito.internal.matchers.Contains
 
containsAll(Collection<?>) - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
 
ContainsExtraTypeInfo - Interface in org.mockito.internal.matchers
Intended to use in certain ArgumentMatchers.
containsKey(K) - Method in class org.mockito.internal.util.concurrent.WeakConcurrentMap
 
containsKey(K) - Method in class org.mockito.internal.util.concurrent.WeakConcurrentMap.WithInlinedExpunction
 
Contents - Search tag in class org.mockito.Mockito
Section
contextualActualTypeParameters - Variable in class org.mockito.internal.util.reflection.GenericMetadataSupport
Represents actual type variables resolved for current class.
copySelfWithNewVerificationMode(VerificationMode) - Method in class org.mockito.internal.verification.VerificationWrapper
 
copySelfWithNewVerificationMode(VerificationMode) - Method in class org.mockito.verification.After
 
copySelfWithNewVerificationMode(VerificationMode) - Method in class org.mockito.verification.Timeout
 
copyToMock(T, T) - Method in class org.mockito.internal.util.reflection.LenientCopyTool
 
copyToRealObject(T, T) - Method in class org.mockito.internal.util.reflection.LenientCopyTool
 
copyWithVerificationMode(VerificationMode) - Method in class org.mockito.internal.verification.VerificationOverTimeImpl
 
create() - Static method in class org.mockito.internal.debugging.LocationFactory
 
create(boolean) - Static method in class org.mockito.internal.debugging.LocationFactory
 
create(Class<?>) - Method in class org.mockito.internal.runners.RunnerFactory
Creates silent runner implementation
create(Class<?>, Supplier<MockitoTestListener>) - Method in class org.mockito.internal.runners.RunnerFactory
Creates runner implementation with provided listener supplier
createArgumentsAreDifferentException(String, String, String) - Static method in class org.mockito.internal.junit.ExceptionFactory
Returns an AssertionError that describes the fact that the arguments of an invocation are different.
createConstructionMock(Class<T>, Function<MockedConstruction.Context, MockCreationSettings<T>>, Function<MockedConstruction.Context, MockHandler<T>>, MockedConstruction.MockInitializer<T>) - Method in class org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker
 
createConstructionMock(Class<T>, Function<MockedConstruction.Context, MockCreationSettings<T>>, Function<MockedConstruction.Context, MockHandler<T>>, MockedConstruction.MockInitializer<T>) - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
createConstructionMock(Class<T>, Function<MockedConstruction.Context, MockCreationSettings<T>>, Function<MockedConstruction.Context, MockHandler<T>>, MockedConstruction.MockInitializer<T>) - Method in interface org.mockito.plugins.MockMaker
If you want to provide your own implementation of MockMaker this method should: Intercept all constructions of the specified type in the current thread Only intercept the construction after being enabled. Stops the interception when disabled.
createConstructionMock(Class<T>, Function<MockedConstruction.Context, MockCreationSettings<T>>, MockedConstruction.MockInitializer<T>) - Static method in class org.mockito.internal.util.MockUtil
 
createFrom(List<Invocation>) - Static method in class org.mockito.internal.invocation.InvocationMatcher
 
createInvocation(Object, Method, Object[], RealMethod, MockCreationSettings, Location) - Static method in class org.mockito.internal.invocation.DefaultInvocationFactory
 
createInvocation(Object, MockCreationSettings, Method, Callable, Object...) - Method in class org.mockito.internal.invocation.DefaultInvocationFactory
 
createInvocation(Object, MockCreationSettings, Method, InvocationFactory.RealMethodBehavior, Object...) - Method in class org.mockito.internal.invocation.DefaultInvocationFactory
 
createInvocation(Object, MockCreationSettings, Method, InvocationFactory.RealMethodBehavior, Object...) - Method in interface org.mockito.invocation.InvocationFactory
Creates instance of an Invocation object.
createMock(MockCreationSettings<T>) - Static method in class org.mockito.internal.util.MockUtil
 
createMock(MockCreationSettings<T>, MockHandler) - Method in class org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker
 
createMock(MockCreationSettings<T>, MockHandler) - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
createMock(MockCreationSettings<T>, MockHandler) - Method in class org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker
 
createMock(MockCreationSettings<T>, MockHandler) - Method in class org.mockito.internal.creation.proxy.ProxyMockMaker
 
createMock(MockCreationSettings<T>, MockHandler) - Method in interface org.mockito.plugins.MockMaker
If you want to provide your own implementation of MockMaker this method should: Create a proxy object that implements settings.typeToMock and potentially also settings.extraInterfaces. You may use the information from settings to create/configure your proxy object. Your proxy object should carry the handler with it.
createMockHandler(MockCreationSettings<T>) - Static method in class org.mockito.internal.handler.MockHandlerFactory
 
createMockType(MockCreationSettings<T>) - Method in class org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker
 
createMockType(MockCreationSettings<T>) - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
createMockType(MockCreationSettings<T>) - Method in class org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker
 
createObjectArray(Object) - Static method in class org.mockito.internal.matchers.ArrayEquals
 
createSpy(MockCreationSettings<T>, MockHandler, T) - Method in class org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker
 
createSpy(MockCreationSettings<T>, MockHandler, T) - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
createSpy(MockCreationSettings<T>, MockHandler, T) - Method in interface org.mockito.plugins.MockMaker
By implementing this method, a mock maker can optionally support the creation of spies where all fields are set within a constructor.
createStaticMock(Class<T>, MockCreationSettings<T>) - Static method in class org.mockito.internal.util.MockUtil
 
createStaticMock(Class<T>, MockCreationSettings<T>, MockHandler) - Method in class org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker
 
createStaticMock(Class<T>, MockCreationSettings<T>, MockHandler) - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
 
createStaticMock(Class<T>, MockCreationSettings<T>, MockHandler) - Method in interface org.mockito.plugins.MockMaker
If you want to provide your own implementation of MockMaker this method should: Alter the supplied class to only change its behavior in the current thread. Only alters the static method's behavior after being enabled. Stops the altered behavior when disabled.
createStrict(Class<?>) - Method in class org.mockito.internal.runners.RunnerFactory
Creates strict runner implementation
createStrictStubs(Class<?>) - Method in class org.mockito.internal.runners.RunnerFactory
Creates strict stubs runner implementation TODO, let's try to apply Brice suggestion and use switch + Strictness
CreationSettings<T> - Class in org.mockito.internal.creation.settings
 
CreationSettings() - Constructor for class org.mockito.internal.creation.settings.CreationSettings
 
CreationSettings(CreationSettings) - Constructor for class org.mockito.internal.creation.settings.CreationSettings
 
Custom Argument ArgumentMatchers - Search tag in class org.mockito.ArgumentMatchers
Section
A B C D E F G H I J K L M N O P R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form