Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
S
- 10. Stubbing consecutive calls (iterator-style stubbing) - Search tag in class org.mockito.Mockito
- Section
- 11. Stubbing with callbacks - Search tag in class org.mockito.Mockito
- Section
- 13. Spying on real objects - Search tag in class org.mockito.Mockito
- Section
- 20. Serializable mocks (Since 1.8.1) - Search tag in class org.mockito.Mockito
- Section
- 30. Spying or mocking abstract classes (Since 1.10.12, further enhanced in 2.7.13 and 2.7.14) - Search tag in class org.mockito.Mockito
- Section
- 34. Switch on or off plugins (Since 1.10.15) - Search tag in class org.mockito.Mockito
- Section
- 5. Stubbing void methods with exceptions - Search tag in class org.mockito.Mockito
- Section
- 53. Specifying mock maker for individual mocks (Since 4.8.0) - Search tag in class org.mockito.Mockito
- Section
- 9. Shorthand for mocks creation - Mock annotation - Search tag in class org.mockito.Mockito
- Section
- same(T) - Static method in class org.mockito.ArgumentMatchers
-
Object argument that is the same as the given value.
- Same - Class in org.mockito.internal.matchers
- Same(Object) - Constructor for class org.mockito.internal.matchers.Same
- ScenarioPrinter - Class in org.mockito.internal.exceptions.util
- ScenarioPrinter() - Constructor for class org.mockito.internal.exceptions.util.ScenarioPrinter
- ScopedMock - Interface in org.mockito
-
Represents a mock with a thread-local explicit scope.
- SequenceNumber - Class in org.mockito.internal.progress
- serializable() - Method in class org.mockito.internal.creation.MockSettingsImpl
- serializable() - Element in annotation type org.mockito.Mock
-
Mock will be serializable, see
MockSettings.serializable()
. - serializable() - Method in interface org.mockito.MockSettings
-
Configures the mock to be serializable.
- serializable(SerializableMode) - Method in class org.mockito.internal.creation.MockSettingsImpl
- serializable(SerializableMode) - Method in interface org.mockito.MockSettings
-
Configures the mock to be serializable with a specific serializable mode.
- SerializableMethod - Class in org.mockito.internal.invocation
- SerializableMethod(Method) - Constructor for class org.mockito.internal.invocation.SerializableMethod
- serializableMode - Variable in class org.mockito.internal.creation.settings.CreationSettings
- SerializableMode - Enum in org.mockito.mock
-
Mock serializable style.
- serializableWontWorkForObjectsThatDontImplementSerializable(Class<?>) - Static method in class org.mockito.internal.exceptions.Reporter
- set(Object) - Method in class org.mockito.internal.util.reflection.BeanPropertySetter
-
Set the value to the property represented by this
BeanPropertySetter
- set(Object) - Method in class org.mockito.internal.util.reflection.InstanceField
-
Set the given value to the field of this instance.
- set(Field, Object, Object) - Method in class org.mockito.internal.util.reflection.ModuleMemberAccessor
- set(Field, Object, Object) - Method in class org.mockito.internal.util.reflection.ReflectionMemberAccessor
- set(Field, Object, Object) - Method in interface org.mockito.plugins.MemberAccessor
- set(String, MockMethodDispatcher) - Static method in class org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher
- set(T) - Method in class org.mockito.internal.util.concurrent.DetachedThreadLocal
- setAnswersForStubbing(List<Answer<?>>, Strictness) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
-
Sets the answers declared with 'doAnswer' style.
- setExtraInterfaces(Set<Class<?>>) - Method in class org.mockito.internal.creation.settings.CreationSettings
- setGenericTypeToMock(Type) - Method in class org.mockito.internal.creation.settings.CreationSettings
- setInvocationForPotentialStubbing(MatchableInvocation) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
- setListenerDirty() - Method in class org.mockito.internal.junit.UniversalTestListener
-
Marks listener as dirty, scheduled for cleanup when the next session starts
- setMatchersToBeDescribedWithExtraTypeInfo(Integer[]) - Method in class org.mockito.internal.reporting.PrintSettings
- setMatchersToBeDescribedWithFullName(Set<String>) - Method in class org.mockito.internal.reporting.PrintSettings
- setMethodForStubbing(MatchableInvocation) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
- setMock(Object) - Method in interface org.mockito.listeners.VerificationStartedEvent
-
Replaces existing mock object for verification with a different one.
- setMockitoInterceptor(MockMethodInterceptor) - Method in interface org.mockito.internal.creation.bytebuddy.MockAccess
- setMockName(MockName) - Method in class org.mockito.internal.creation.settings.CreationSettings
- setMockType(MockType) - Method in class org.mockito.internal.creation.settings.CreationSettings
- setMultiline(boolean) - Method in class org.mockito.internal.reporting.PrintSettings
- Sets - Class in org.mockito.internal.util.collections
- Sets() - Constructor for class org.mockito.internal.util.collections.Sets
- setSerializableMode(SerializableMode) - Method in class org.mockito.internal.creation.settings.CreationSettings
- setStrictness(Strictness) - Method in class org.mockito.internal.framework.DefaultMockitoSession
- setStrictness(Strictness) - Method in class org.mockito.internal.junit.UniversalTestListener
- setStrictness(Strictness) - Method in class org.mockito.internal.stubbing.OngoingStubbingImpl
- setStrictness(Strictness) - Method in interface org.mockito.MockitoSession
-
Changes the strictness of this
MockitoSession
. - setTypeToMock(Class<T>) - Method in class org.mockito.internal.creation.settings.CreationSettings
- setVerificationStrategy(VerificationStrategy) - Method in interface org.mockito.internal.progress.MockingProgress
- setVerificationStrategy(VerificationStrategy) - Method in class org.mockito.internal.progress.MockingProgressImpl
- shortThat(Matcher<Short>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
-
Enables integrating hamcrest matchers that match primitive
short
arguments. - shortThat(ArgumentMatcher<Short>) - Static method in class org.mockito.ArgumentMatchers
-
Allows creating custom
short
argument matchers. - should() - Method in interface org.mockito.BDDMockito.Then
- should(InOrder) - Method in interface org.mockito.BDDMockito.Then
- should(InOrder, VerificationMode) - Method in interface org.mockito.BDDMockito.Then
- should(VerificationMode) - Method in interface org.mockito.BDDMockito.Then
- shouldBeReported(Stubbing) - Static method in class org.mockito.internal.stubbing.UnusedStubbingReporting
-
Decides if the stubbing should be reported as unused.
- shouldHaveNoInteractions() - Method in interface org.mockito.BDDMockito.Then
- shouldHaveNoMoreInteractions() - Method in interface org.mockito.BDDMockito.Then
- silent() - Method in class org.mockito.internal.junit.JUnitRule
- silent() - Method in class org.mockito.internal.junit.JUnitTestRule
- silent() - Method in interface org.mockito.junit.MockitoRule
-
Rule will not report stubbing warnings during test execution.
- silent() - Method in interface org.mockito.junit.MockitoTestRule
-
Equivalent to
MockitoRule.silent()
. - Silent(Class<?>) - Constructor for class org.mockito.junit.MockitoJUnitRunner.Silent
- SingleRegisteredInvocation - Class in org.mockito.internal.verification
- SingleRegisteredInvocation() - Constructor for class org.mockito.internal.verification.SingleRegisteredInvocation
- size() - Method in class org.mockito.internal.junit.UnusedStubbings
- size() - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
- smartNullPointerException(String, Location) - Static method in class org.mockito.internal.exceptions.Reporter
- SmartNullPointerException - Exception Class in org.mockito.exceptions.verification
- SmartNullPointerException(String) - Constructor for exception class org.mockito.exceptions.verification.SmartNullPointerException
- SmartPrinter - Class in org.mockito.internal.reporting
-
Makes sure both wanted and actual are printed consistently (single line or multiline)
- SmartPrinter(MatchableInvocation, List<Invocation>, Integer[], Set<String>) - Constructor for class org.mockito.internal.reporting.SmartPrinter
- SmartPrinter(MatchableInvocation, Invocation, Integer...) - Constructor for class org.mockito.internal.reporting.SmartPrinter
- sortSuperTypesLast(Collection<? extends Field>) - Static method in class org.mockito.internal.util.reflection.SuperTypesLastSorter
-
Return a new collection with the fields sorted first by name, then with any fields moved after their supertypes.
- spiedInstance - Variable in class org.mockito.internal.creation.settings.CreationSettings
- spiedInstance(Object) - Method in class org.mockito.internal.creation.MockSettingsImpl
- spiedInstance(Object) - Method in interface org.mockito.MockSettings
-
Specifies the instance to spy on.
- spy(Class<T>) - Static method in class org.mockito.Mockito
-
Please refer to the documentation of
Mockito.spy(Object)
. - spy(T) - Static method in class org.mockito.Mockito
-
Creates a spy of the real object.
- spy(T...) - Static method in class org.mockito.Mockito
-
Please refer to the documentation of
Mockito.spy(Class)
. - Spy - Annotation Type in org.mockito
-
Allows shorthand wrapping of field instances in a spy object.
- spyAndDelegateAreMutuallyExclusive() - Static method in class org.mockito.internal.exceptions.Reporter
- SpyAnnotationEngine - Class in org.mockito.internal.configuration
-
Process fields annotated with @Spy.
- SpyAnnotationEngine() - Constructor for class org.mockito.internal.configuration.SpyAnnotationEngine
- SpyOnInjectedFieldsHandler - Class in org.mockito.internal.configuration.injection
-
Handler for field annotated with @InjectMocks and @Spy.
- SpyOnInjectedFieldsHandler() - Constructor for class org.mockito.internal.configuration.injection.SpyOnInjectedFieldsHandler
- StackTraceCleaner - Interface in org.mockito.exceptions.stacktrace
-
Decides if particular StackTraceElement is excluded from the human-readable stack trace output.
- StackTraceCleaner.StackFrameMetadata - Interface in org.mockito.exceptions.stacktrace
-
Very similar to the StackFrame class declared on the StackWalker api.
- StackTraceCleanerProvider - Interface in org.mockito.plugins
-
An extension point to register custom
StackTraceCleaner
. - StackTraceFilter - Class in org.mockito.internal.exceptions.stacktrace
- StackTraceFilter() - Constructor for class org.mockito.internal.exceptions.stacktrace.StackTraceFilter
- start() - Method in class org.mockito.internal.util.Timer
-
Starts the timer count down.
- startMocking() - Method in class org.mockito.internal.session.DefaultMockitoSessionBuilder
- startMocking() - Method in interface org.mockito.session.MockitoSessionBuilder
-
Starts new mocking session! Creates new
MockitoSession
instance to initialize the session. - startsWith(String) - Static method in class org.mockito.ArgumentMatchers
-
String
argument that starts with the given prefix. - StartsWith - Class in org.mockito.internal.matchers
- StartsWith(String) - Constructor for class org.mockito.internal.matchers.StartsWith
- STATIC - Enum constant in enum org.mockito.mock.MockType
-
Mock replaces the mocked type through static mocking
- Strict(Class<?>) - Constructor for class org.mockito.junit.MockitoJUnitRunner.Strict
- STRICT_STUBS - Enum constant in enum org.mockito.Mock.Strictness
- STRICT_STUBS - Enum constant in enum org.mockito.quality.Strictness
-
Ensures clean tests, reduces test code duplication, improves debuggability.
- strictness - Variable in class org.mockito.internal.creation.settings.CreationSettings
- strictness() - Element in annotation type org.mockito.Mock
-
Mock will have custom strictness, see
MockSettings.strictness(org.mockito.quality.Strictness)
. - strictness(Strictness) - Method in class org.mockito.internal.creation.MockSettingsImpl
- strictness(Strictness) - Method in class org.mockito.internal.junit.JUnitRule
- strictness(Strictness) - Method in class org.mockito.internal.junit.JUnitTestRule
- strictness(Strictness) - Method in class org.mockito.internal.session.DefaultMockitoSessionBuilder
- strictness(Strictness) - Method in interface org.mockito.junit.MockitoRule
-
The strictness, especially "strict stubs" (
Strictness.STRICT_STUBS
) helps debugging and keeping tests clean. - strictness(Strictness) - Method in interface org.mockito.junit.MockitoTestRule
-
Equivalent to
MockitoRule.strictness(Strictness)
. - strictness(Strictness) - Method in interface org.mockito.MockSettings
-
Specifies strictness level for the mock.
- strictness(Strictness) - Method in interface org.mockito.session.MockitoSessionBuilder
-
Configures strictness of
MockitoSession
instance. - Strictness - Enum in org.mockito.quality
-
Configures the "strictness" of Mockito, affecting the behavior of stubbings and verification.
- strictnessDoesNotAcceptNullParameter() - Static method in class org.mockito.internal.exceptions.Reporter
- StrictnessSelector - Class in org.mockito.internal.stubbing
-
Helps determining the actual strictness given that it can be configured in multiple ways (at mock, at stubbing, in rule)
- StrictRunner - Class in org.mockito.internal.runners
- StrictRunner(InternalRunner, Class<?>) - Constructor for class org.mockito.internal.runners.StrictRunner
- StrictStubs(Class<?>) - Constructor for class org.mockito.junit.MockitoJUnitRunner.StrictStubs
- StrictStubsRunnerTestListener - Class in org.mockito.internal.junit
-
Fails early when mismatched arguments used for stubbing
- StrictStubsRunnerTestListener() - Constructor for class org.mockito.internal.junit.StrictStubsRunnerTestListener
- StringUtil - Class in org.mockito.internal.util
- stripAnnotations - Variable in class org.mockito.internal.creation.settings.CreationSettings
- stubbedAt() - Method in class org.mockito.internal.invocation.StubInfoImpl
- stubbedAt() - Method in interface org.mockito.invocation.StubInfo
- StubbedInvocationMatcher - Class in org.mockito.internal.stubbing
- StubbedInvocationMatcher(Answer, MatchableInvocation, Strictness) - Constructor for class org.mockito.internal.stubbing.StubbedInvocationMatcher
- stubber() - Method in class org.mockito.internal.MockitoCore
- stubber(Strictness) - Method in class org.mockito.internal.MockitoCore
- Stubber - Interface in org.mockito.stubbing
-
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style
- StubberImpl - Class in org.mockito.internal.stubbing
- StubberImpl(Strictness) - Constructor for class org.mockito.internal.stubbing.StubberImpl
- Stubbing - Interface in org.mockito.stubbing
-
Stubbing declared on the mock object.
- StubbingComparator - Class in org.mockito.internal.stubbing
-
Compares stubbings based on
InvocationComparator
- StubbingComparator() - Constructor for class org.mockito.internal.stubbing.StubbingComparator
- stubbingCompleted() - Method in interface org.mockito.internal.progress.MockingProgress
- stubbingCompleted() - Method in class org.mockito.internal.progress.MockingProgressImpl
- StubbingLookupEvent - Interface in org.mockito.listeners
-
Represent an information about the looked up stubbing
- StubbingLookupListener - Interface in org.mockito.listeners
-
When a method is called on a mock object Mockito looks up any stubbings recorded on that mock.
- stubbingLookupListeners - Variable in class org.mockito.internal.creation.settings.CreationSettings
- stubbingLookupListeners(StubbingLookupListener...) - Method in class org.mockito.internal.creation.MockSettingsImpl
- stubbingLookupListeners(StubbingLookupListener...) - Method in interface org.mockito.MockSettings
-
Add stubbing lookup listener to the mock object.
- StubbingLookupNotifier - Class in org.mockito.internal.listeners
- stubbingStarted() - Method in interface org.mockito.internal.progress.MockingProgress
- stubbingStarted() - Method in class org.mockito.internal.progress.MockingProgressImpl
- stubInfo() - Method in class org.mockito.internal.invocation.InterceptedInvocation
- stubInfo() - Method in interface org.mockito.invocation.Invocation
- StubInfo - Interface in org.mockito.invocation
-
The information about stubbing, for example the location of stubbing.
- StubInfoImpl - Class in org.mockito.internal.invocation
- StubInfoImpl(DescribedInvocation) - Constructor for class org.mockito.internal.invocation.StubInfoImpl
- stubOnly - Variable in class org.mockito.internal.creation.settings.CreationSettings
- stubOnly() - Method in class org.mockito.internal.creation.MockSettingsImpl
- stubOnly() - Element in annotation type org.mockito.Mock
-
Mock will be 'stubOnly', see
MockSettings.stubOnly()
. - stubOnly() - Method in interface org.mockito.MockSettings
-
A stub-only mock does not record method invocations, thus saving memory but disallowing verification of invocations.
- stubPassedToVerify(Object) - Static method in class org.mockito.internal.exceptions.Reporter
- SUBCLASS - Static variable in class org.mockito.MockMakers
-
Subclass mock maker which mocks types by creating subclasses.
- SubclassByteBuddyMockMaker - Class in org.mockito.internal.creation.bytebuddy
-
Subclass based mock maker.
- SubclassByteBuddyMockMaker() - Constructor for class org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker
- SubclassByteBuddyMockMaker(SubclassLoader) - Constructor for class org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker
- SubclassLoader - Interface in org.mockito.internal.creation.bytebuddy
-
A subclass loader is responsible for resolving a class loading strategy for a mock that is implemented as a subclass.
- SuperTypesLastSorter - Class in org.mockito.internal.util.reflection
-
Sort fields in an order suitable for injection, by name with superclasses moved after their subclasses.
- Supplier<T> - Interface in org.mockito.internal.util
-
Abstract provider that can supply (provide/create) objects of given type.
- SuppressSignatureCheck - Annotation Type in org.mockito.internal
- SuspendMethod - Class in org.mockito.internal.creation
-
Utilities for Kotlin Continuation-Passing-Style suspending function, detecting and trimming last hidden parameter.
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form