#2048 Fixes #1597 : Adds lenient for BDD Mockito

Open holubec-petr
Coverage Reach
src/main/java/org/mockito/internal/creation/bytebuddy/InlineByteBuddyMockMaker.java src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java src/main/java/org/mockito/internal/creation/bytebuddy/InlineBytecodeGenerator.java src/main/java/org/mockito/internal/creation/bytebuddy/ModuleHandler.java src/main/java/org/mockito/internal/creation/bytebuddy/SubclassBytecodeGenerator.java src/main/java/org/mockito/internal/creation/bytebuddy/ByteBuddyCrossClassLoaderSerializationSupport.java src/main/java/org/mockito/internal/creation/bytebuddy/SubclassByteBuddyMockMaker.java src/main/java/org/mockito/internal/creation/bytebuddy/SubclassInjectionLoader.java src/main/java/org/mockito/internal/creation/bytebuddy/TypeCachingBytecodeGenerator.java src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodInterceptor.java src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.java src/main/java/org/mockito/internal/creation/bytebuddy/ByteBuddyMockMaker.java src/main/java/org/mockito/internal/creation/bytebuddy/MockFeatures.java src/main/java/org/mockito/internal/creation/instance/ConstructorInstantiator.java src/main/java/org/mockito/internal/creation/instance/InstantiatorProvider2Adapter.java src/main/java/org/mockito/internal/creation/instance/InstantiatorProviderAdapter.java src/main/java/org/mockito/internal/creation/instance/DefaultInstantiatorProvider.java src/main/java/org/mockito/internal/creation/instance/ObjenesisInstantiator.java src/main/java/org/mockito/internal/creation/instance/InstantiationException.java src/main/java/org/mockito/internal/creation/MockSettingsImpl.java src/main/java/org/mockito/internal/creation/settings/CreationSettings.java src/main/java/org/mockito/internal/creation/DelegatingMethod.java src/main/java/org/mockito/internal/creation/SuspendMethod.java src/main/java/org/mockito/internal/util/reflection/GenericMetadataSupport.java src/main/java/org/mockito/internal/util/reflection/InstrumentationMemberAccessor.java src/main/java/org/mockito/internal/util/reflection/FieldInitializer.java src/main/java/org/mockito/internal/util/reflection/Fields.java src/main/java/org/mockito/internal/util/reflection/ReflectionMemberAccessor.java src/main/java/org/mockito/internal/util/reflection/BeanPropertySetter.java src/main/java/org/mockito/internal/util/reflection/InstanceField.java src/main/java/org/mockito/internal/util/reflection/GenericTypeExtractor.java src/main/java/org/mockito/internal/util/reflection/SuperTypesLastSorter.java src/main/java/org/mockito/internal/util/reflection/LenientCopyTool.java src/main/java/org/mockito/internal/util/reflection/ModuleMemberAccessor.java src/main/java/org/mockito/internal/util/reflection/FieldReader.java src/main/java/org/mockito/internal/util/reflection/GenericMaster.java src/main/java/org/mockito/internal/util/reflection/FieldInitializationReport.java src/main/java/org/mockito/internal/util/concurrent/WeakConcurrentMap.java src/main/java/org/mockito/internal/util/concurrent/DetachedThreadLocal.java src/main/java/org/mockito/internal/util/concurrent/WeakConcurrentSet.java src/main/java/org/mockito/internal/util/collections/HashCodeAndEqualsSafeSet.java src/main/java/org/mockito/internal/util/collections/HashCodeAndEqualsMockWrapper.java src/main/java/org/mockito/internal/util/collections/ListUtil.java src/main/java/org/mockito/internal/util/collections/Iterables.java src/main/java/org/mockito/internal/util/collections/IdentitySet.java src/main/java/org/mockito/internal/util/collections/Sets.java src/main/java/org/mockito/internal/util/MockUtil.java src/main/java/org/mockito/internal/util/JavaEightUtil.java src/main/java/org/mockito/internal/util/Primitives.java src/main/java/org/mockito/internal/util/Platform.java src/main/java/org/mockito/internal/util/io/IOUtil.java src/main/java/org/mockito/internal/util/StringUtil.java src/main/java/org/mockito/internal/util/MockCreationValidator.java src/main/java/org/mockito/internal/util/DefaultMockingDetails.java src/main/java/org/mockito/internal/util/MockNameImpl.java src/main/java/org/mockito/internal/util/Timer.java src/main/java/org/mockito/internal/util/Checks.java src/main/java/org/mockito/internal/util/ObjectMethodsGuru.java src/main/java/org/mockito/internal/util/ConsoleMockitoLogger.java src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsEmptyValues.java src/main/java/org/mockito/internal/stubbing/defaultanswers/RetrieveGenericsForDefaultAnswers.java src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsDeepStubs.java src/main/java/org/mockito/internal/stubbing/defaultanswers/ForwardsInvocations.java src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsSmartNulls.java src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsMoreEmptyValues.java src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsMocks.java src/main/java/org/mockito/internal/stubbing/defaultanswers/TriesToReturnSelf.java src/main/java/org/mockito/internal/stubbing/defaultanswers/GloballyConfiguredAnswer.java src/main/java/org/mockito/internal/stubbing/answers/AnswerFunctionalInterfaces.java src/main/java/org/mockito/internal/stubbing/answers/ReturnsArgumentAt.java src/main/java/org/mockito/internal/stubbing/answers/InvocationInfo.java src/main/java/org/mockito/internal/stubbing/answers/AbstractThrowsException.java src/main/java/org/mockito/internal/stubbing/answers/Returns.java src/main/java/org/mockito/internal/stubbing/answers/ClonesArguments.java src/main/java/org/mockito/internal/stubbing/answers/AnswersWithDelay.java src/main/java/org/mockito/internal/stubbing/answers/DefaultAnswerValidator.java src/main/java/org/mockito/internal/stubbing/answers/CallsRealMethods.java src/main/java/org/mockito/internal/stubbing/answers/ReturnsElementsOf.java src/main/java/org/mockito/internal/stubbing/answers/DoesNothing.java src/main/java/org/mockito/internal/stubbing/answers/ThrowsExceptionForClassType.java src/main/java/org/mockito/internal/stubbing/answers/ThrowsException.java src/main/java/org/mockito/internal/stubbing/InvocationContainerImpl.java src/main/java/org/mockito/internal/stubbing/StubberImpl.java src/main/java/org/mockito/internal/stubbing/BaseStubbing.java src/main/java/org/mockito/internal/stubbing/StubbedInvocationMatcher.java src/main/java/org/mockito/internal/stubbing/DefaultLenientStubber.java src/main/java/org/mockito/internal/stubbing/DoAnswerStyleStubbing.java src/main/java/org/mockito/internal/stubbing/OngoingStubbingImpl.java src/main/java/org/mockito/internal/stubbing/StrictnessSelector.java src/main/java/org/mockito/internal/stubbing/ConsecutiveStubbing.java src/main/java/org/mockito/internal/stubbing/StubbingComparator.java src/main/java/org/mockito/internal/stubbing/UnusedStubbingReporting.java src/main/java/org/mockito/internal/configuration/injection/filter/NameBasedCandidateFilter.java src/main/java/org/mockito/internal/configuration/injection/filter/TerminalMockCandidateFilter.java src/main/java/org/mockito/internal/configuration/injection/filter/TypeBasedCandidateFilter.java src/main/java/org/mockito/internal/configuration/injection/filter/OngoingInjector.java src/main/java/org/mockito/internal/configuration/injection/PropertyAndSetterInjection.java src/main/java/org/mockito/internal/configuration/injection/scanner/MockScanner.java src/main/java/org/mockito/internal/configuration/injection/scanner/InjectMocksScanner.java src/main/java/org/mockito/internal/configuration/injection/MockInjection.java src/main/java/org/mockito/internal/configuration/injection/ConstructorInjection.java src/main/java/org/mockito/internal/configuration/injection/SpyOnInjectedFieldsHandler.java src/main/java/org/mockito/internal/configuration/injection/MockInjectionStrategy.java src/main/java/org/mockito/internal/configuration/plugins/PluginInitializer.java src/main/java/org/mockito/internal/configuration/plugins/DefaultMockitoPlugins.java src/main/java/org/mockito/internal/configuration/plugins/PluginLoader.java src/main/java/org/mockito/internal/configuration/plugins/PluginRegistry.java src/main/java/org/mockito/internal/configuration/plugins/PluginFinder.java src/main/java/org/mockito/internal/configuration/plugins/PluginFileReader.java src/main/java/org/mockito/internal/configuration/plugins/Plugins.java src/main/java/org/mockito/internal/configuration/plugins/DefaultPluginSwitch.java src/main/java/org/mockito/internal/configuration/SpyAnnotationEngine.java src/main/java/org/mockito/internal/configuration/InjectingAnnotationEngine.java src/main/java/org/mockito/internal/configuration/IndependentAnnotationEngine.java src/main/java/org/mockito/internal/configuration/MockAnnotationProcessor.java src/main/java/org/mockito/internal/configuration/GlobalConfiguration.java src/main/java/org/mockito/internal/configuration/ClassPathLoader.java src/main/java/org/mockito/internal/configuration/DefaultInjectionEngine.java src/main/java/org/mockito/internal/configuration/CaptorAnnotationProcessor.java src/main/java/org/mockito/internal/matchers/apachecommons/EqualsBuilder.java src/main/java/org/mockito/internal/matchers/apachecommons/ReflectionEquals.java src/main/java/org/mockito/internal/matchers/text/ValuePrinter.java src/main/java/org/mockito/internal/matchers/text/MatcherToString.java src/main/java/org/mockito/internal/matchers/text/MatchersPrinter.java src/main/java/org/mockito/internal/matchers/text/FormattedText.java src/main/java/org/mockito/internal/matchers/ArrayEquals.java src/main/java/org/mockito/internal/matchers/CapturingMatcher.java src/main/java/org/mockito/internal/matchers/Equals.java src/main/java/org/mockito/internal/matchers/InstanceOf.java src/main/java/org/mockito/internal/matchers/Equality.java src/main/java/org/mockito/internal/matchers/EqualsWithDelta.java src/main/java/org/mockito/internal/matchers/CompareTo.java src/main/java/org/mockito/internal/matchers/Matches.java src/main/java/org/mockito/internal/matchers/Or.java src/main/java/org/mockito/internal/matchers/And.java src/main/java/org/mockito/internal/matchers/LocalizedMatcher.java src/main/java/org/mockito/internal/matchers/Not.java src/main/java/org/mockito/internal/matchers/Find.java src/main/java/org/mockito/internal/matchers/EndsWith.java src/main/java/org/mockito/internal/matchers/StartsWith.java src/main/java/org/mockito/internal/matchers/Contains.java src/main/java/org/mockito/internal/matchers/Same.java src/main/java/org/mockito/internal/matchers/LessThan.java src/main/java/org/mockito/internal/matchers/LessOrEqual.java src/main/java/org/mockito/internal/matchers/Any.java src/main/java/org/mockito/internal/matchers/GreaterThan.java src/main/java/org/mockito/internal/matchers/CompareEqual.java src/main/java/org/mockito/internal/matchers/GreaterOrEqual.java src/main/java/org/mockito/internal/matchers/NotNull.java src/main/java/org/mockito/internal/matchers/Null.java src/main/java/org/mockito/internal/invocation/InvocationsFinder.java src/main/java/org/mockito/internal/invocation/InvocationMatcher.java src/main/java/org/mockito/internal/invocation/InterceptedInvocation.java src/main/java/org/mockito/internal/invocation/SerializableMethod.java src/main/java/org/mockito/internal/invocation/MatcherApplicationStrategy.java src/main/java/org/mockito/internal/invocation/ArgumentsProcessor.java src/main/java/org/mockito/internal/invocation/finder/AllInvocationsFinder.java src/main/java/org/mockito/internal/invocation/finder/VerifiableInvocationsFinder.java src/main/java/org/mockito/internal/invocation/RealMethod.java src/main/java/org/mockito/internal/invocation/mockref/MockStrongReference.java src/main/java/org/mockito/internal/invocation/mockref/MockWeakReference.java src/main/java/org/mockito/internal/invocation/TypeSafeMatching.java src/main/java/org/mockito/internal/invocation/MatchersBinder.java src/main/java/org/mockito/internal/invocation/DefaultInvocationFactory.java src/main/java/org/mockito/internal/invocation/InvocationMarker.java src/main/java/org/mockito/internal/invocation/UnusedStubsFinder.java src/main/java/org/mockito/internal/invocation/StubInfoImpl.java src/main/java/org/mockito/internal/invocation/InvocationComparator.java src/main/java/org/mockito/internal/verification/checkers/NumberOfInvocationsChecker.java src/main/java/org/mockito/internal/verification/checkers/MissingInvocationChecker.java src/main/java/org/mockito/internal/verification/checkers/AtLeastXNumberOfInvocationsChecker.java src/main/java/org/mockito/internal/verification/checkers/AtLeastDiscrepancy.java src/main/java/org/mockito/internal/verification/VerificationOverTimeImpl.java src/main/java/org/mockito/internal/verification/VerificationWrapperInOrderWrapper.java src/main/java/org/mockito/internal/verification/DefaultRegisteredInvocations.java src/main/java/org/mockito/internal/verification/MockAwareVerificationMode.java src/main/java/org/mockito/internal/verification/AtMost.java src/main/java/org/mockito/internal/verification/Times.java src/main/java/org/mockito/internal/verification/argumentmatching/ArgumentMatchingTool.java src/main/java/org/mockito/internal/verification/AtLeast.java src/main/java/org/mockito/internal/verification/VerificationWrapper.java src/main/java/org/mockito/internal/verification/VerificationDataImpl.java src/main/java/org/mockito/internal/verification/Calls.java src/main/java/org/mockito/internal/verification/Only.java src/main/java/org/mockito/internal/verification/VerificationModeFactory.java src/main/java/org/mockito/internal/verification/Description.java src/main/java/org/mockito/internal/verification/NoMoreInteractions.java src/main/java/org/mockito/internal/verification/VerificationEventImpl.java src/main/java/org/mockito/internal/verification/InOrderWrapper.java src/main/java/org/mockito/internal/verification/SingleRegisteredInvocation.java src/main/java/org/mockito/internal/verification/api/VerificationDataInOrderImpl.java src/main/java/org/mockito/internal/verification/NoInteractions.java src/main/java/org/mockito/internal/verification/InOrderContextImpl.java src/main/java/org/mockito/internal/exceptions/Reporter.java src/main/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilter.java src/main/java/org/mockito/internal/exceptions/stacktrace/DefaultStackTraceCleaner.java src/main/java/org/mockito/internal/exceptions/stacktrace/ConditionalStackTraceFilter.java src/main/java/org/mockito/internal/exceptions/stacktrace/DefaultStackTraceCleanerProvider.java src/main/java/org/mockito/internal/exceptions/util/ScenarioPrinter.java src/main/java/org/mockito/internal/exceptions/ExceptionIncludingMockitoWarnings.java src/main/java/org/mockito/internal/junit/VerificationCollectorImpl.java src/main/java/org/mockito/internal/junit/UniversalTestListener.java src/main/java/org/mockito/internal/junit/util/JUnitFailureHacker.java src/main/java/org/mockito/internal/junit/DefaultStubbingLookupListener.java src/main/java/org/mockito/internal/junit/JUnitSessionStore.java src/main/java/org/mockito/internal/junit/UnusedStubbings.java src/main/java/org/mockito/internal/junit/StubbingArgMismatches.java src/main/java/org/mockito/internal/junit/UnusedStubbingsFinder.java src/main/java/org/mockito/internal/junit/ArgMismatchFinder.java src/main/java/org/mockito/internal/junit/MismatchReportingTestListener.java src/main/java/org/mockito/internal/junit/UnnecessaryStubbingsReporter.java src/main/java/org/mockito/internal/junit/ExceptionFactory.java src/main/java/org/mockito/internal/junit/StubbingHint.java src/main/java/org/mockito/internal/junit/JUnitRule.java src/main/java/org/mockito/internal/junit/JUnitTestRule.java src/main/java/org/mockito/internal/junit/DefaultTestFinishedEvent.java src/main/java/org/mockito/internal/junit/StrictStubsRunnerTestListener.java src/main/java/org/mockito/internal/junit/NoOpTestListener.java src/main/java/org/mockito/internal/debugging/LoggingListener.java src/main/java/org/mockito/internal/debugging/VerboseMockInvocationLogger.java src/main/java/org/mockito/internal/debugging/InvocationsPrinter.java src/main/java/org/mockito/internal/debugging/MockitoDebuggerImpl.java src/main/java/org/mockito/internal/debugging/WarningsFinder.java src/main/java/org/mockito/internal/debugging/LocationImpl.java src/main/java/org/mockito/internal/debugging/WarningsPrinterImpl.java src/main/java/org/mockito/internal/debugging/WarningsCollector.java src/main/java/org/mockito/internal/debugging/Localized.java src/main/java/org/mockito/internal/progress/MockingProgressImpl.java src/main/java/org/mockito/internal/progress/ArgumentMatcherStorageImpl.java src/main/java/org/mockito/internal/progress/ThreadSafeMockingProgress.java src/main/java/org/mockito/internal/progress/SequenceNumber.java src/main/java/org/mockito/internal/MockitoCore.java src/main/java/org/mockito/internal/handler/MockHandlerImpl.java src/main/java/org/mockito/internal/handler/NotifiedMethodInvocationReport.java src/main/java/org/mockito/internal/handler/InvocationNotifierHandler.java src/main/java/org/mockito/internal/handler/NullResultGuardian.java src/main/java/org/mockito/internal/handler/MockHandlerFactory.java src/main/java/org/mockito/internal/runners/DefaultInternalRunner.java src/main/java/org/mockito/internal/runners/util/RunnerProvider.java src/main/java/org/mockito/internal/runners/util/TestMethodsFinder.java src/main/java/org/mockito/internal/runners/util/FailureDetector.java src/main/java/org/mockito/internal/runners/RunnerFactory.java src/main/java/org/mockito/internal/runners/StrictRunner.java src/main/java/org/mockito/internal/MockedStaticImpl.java src/main/java/org/mockito/internal/framework/DefaultMockitoSession.java src/main/java/org/mockito/internal/framework/DefaultMockitoFramework.java src/main/java/org/mockito/internal/listeners/VerificationStartedNotifier.java src/main/java/org/mockito/internal/listeners/StubbingLookupNotifier.java src/main/java/org/mockito/internal/reporting/SmartPrinter.java src/main/java/org/mockito/internal/reporting/PrintSettings.java src/main/java/org/mockito/internal/reporting/Discrepancy.java src/main/java/org/mockito/internal/reporting/Pluralizer.java src/main/java/org/mockito/internal/session/DefaultMockitoSessionBuilder.java src/main/java/org/mockito/internal/session/MockitoLoggerAdapter.java src/main/java/org/mockito/internal/session/MockitoSessionLoggerAdapter.java src/main/java/org/mockito/internal/InOrderImpl.java src/main/java/org/mockito/internal/MockedConstructionImpl.java src/main/java/org/mockito/internal/hamcrest/HamcrestArgumentMatcher.java src/main/java/org/mockito/internal/hamcrest/MatcherGenericTypeExtractor.java src/main/java/org/mockito/AdditionalMatchers.java src/main/java/org/mockito/exceptions/verification/opentest4j/ArgumentsAreDifferent.java src/main/java/org/mockito/exceptions/verification/junit/ArgumentsAreDifferent.java src/main/java/org/mockito/exceptions/verification/ArgumentsAreDifferent.java src/main/java/org/mockito/exceptions/verification/WantedButNotInvoked.java src/main/java/org/mockito/exceptions/verification/NeverWantedButInvoked.java src/main/java/org/mockito/exceptions/verification/TooManyActualInvocations.java src/main/java/org/mockito/exceptions/verification/NoInteractionsWanted.java src/main/java/org/mockito/exceptions/verification/MoreThanAllowedActualInvocations.java src/main/java/org/mockito/exceptions/verification/SmartNullPointerException.java src/main/java/org/mockito/exceptions/verification/TooFewActualInvocations.java src/main/java/org/mockito/exceptions/verification/VerificationInOrderFailure.java src/main/java/org/mockito/exceptions/verification/TooLittleActualInvocations.java src/main/java/org/mockito/exceptions/base/MockitoAssertionError.java src/main/java/org/mockito/exceptions/base/MockitoException.java src/main/java/org/mockito/exceptions/base/MockitoSerializationIssue.java src/main/java/org/mockito/exceptions/base/MockitoInitializationException.java src/main/java/org/mockito/exceptions/misusing/MockitoConfigurationException.java src/main/java/org/mockito/exceptions/misusing/InvalidUseOfMatchersException.java src/main/java/org/mockito/exceptions/misusing/PotentialStubbingProblem.java src/main/java/org/mockito/exceptions/misusing/UnfinishedMockingSessionException.java src/main/java/org/mockito/exceptions/misusing/UnfinishedStubbingException.java src/main/java/org/mockito/exceptions/misusing/CannotVerifyStubOnlyMock.java src/main/java/org/mockito/exceptions/misusing/NullInsteadOfMockException.java src/main/java/org/mockito/exceptions/misusing/MissingMethodInvocationException.java src/main/java/org/mockito/exceptions/misusing/WrongTypeOfReturnValue.java src/main/java/org/mockito/exceptions/misusing/FriendlyReminderException.java src/main/java/org/mockito/exceptions/misusing/NotAMockException.java src/main/java/org/mockito/exceptions/misusing/UnnecessaryStubbingException.java src/main/java/org/mockito/exceptions/misusing/RedundantListenerException.java src/main/java/org/mockito/exceptions/misusing/UnfinishedVerificationException.java src/main/java/org/mockito/exceptions/misusing/InjectMocksException.java src/main/java/org/mockito/exceptions/misusing/CannotStubVoidMethodWithReturnValue.java src/main/java/org/mockito/ArgumentMatchers.java src/main/java/org/mockito/Mockito.java src/main/java/org/mockito/BDDMockito.java src/main/java/org/mockito/runners/ConsoleSpammingMockitoJUnitRunner.java src/main/java/org/mockito/runners/VerboseMockitoJUnitRunner.java src/main/java/org/mockito/runners/MockitoJUnitRunner.java src/main/java/org/mockito/hamcrest/MockitoHamcrest.java src/main/java/org/mockito/AdditionalAnswers.java src/main/java/org/mockito/junit/MockitoJUnitRunner.java src/main/java/org/mockito/junit/MockitoJUnit.java src/main/java/org/mockito/verification/Timeout.java src/main/java/org/mockito/verification/After.java src/main/java/org/mockito/verification/VerificationMode.java src/main/java/org/mockito/MockitoAnnotations.java src/main/java/org/mockito/Answers.java src/main/java/org/mockito/plugins/MockMaker.java src/main/java/org/mockito/plugins/AnnotationEngine.java src/main/java/org/mockito/plugins/MemberAccessor.java src/main/java/org/mockito/ArgumentCaptor.java src/main/java/org/mockito/configuration/DefaultMockitoConfiguration.java src/main/java/org/mockito/creation/instance/InstantiationException.java src/main/java/org/mockito/quality/Strictness.java src/main/java/org/mockito/mock/SerializableMode.java src/main/java/org/mockito/MockedStatic.java src/main/java/org/mockito/codegen/InjectionBase.java src/main/java/org/mockito/Matchers.java src/main/java/org/mockito/listeners/MockCreationListener.java subprojects/errorprone/src/main/java/org/mockito/errorprone/bugpatterns/AbstractMockitoAnyForPrimitiveType.java subprojects/errorprone/src/main/java/org/mockito/errorprone/bugpatterns/MockitoAnyIncorrectPrimitiveType.java subprojects/errorprone/src/main/java/org/mockito/errorprone/bugpatterns/MockitoInternalUsage.java subprojects/errorprone/src/main/java/org/mockito/errorprone/bugpatterns/MockitoNotExtensible.java subprojects/errorprone/src/main/java/org/mockito/errorprone/bugpatterns/MockitoAnyClassWithPrimitiveType.java subprojects/junit-jupiter/src/main/java/org/mockito/junit/jupiter/MockitoExtension.java

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -4,7 +4,10 @@
Loading
4 4
 */
5 5
package org.mockito;
6 6
7 +
import org.mockito.internal.stubbing.OngoingStubbingImpl;
8 +
import org.mockito.quality.Strictness;
7 9
import org.mockito.stubbing.Answer;
10 +
import org.mockito.stubbing.LenientStubber;
8 11
import org.mockito.stubbing.OngoingStubbing;
9 12
import org.mockito.stubbing.Stubber;
10 13
import org.mockito.verification.VerificationMode;
@@ -196,7 +199,7 @@
Loading
196 199
    }
197 200
198 201
    /**
199 -
     * see original {@link Mockito#when(Object)}
202 +
     * See original {@link Mockito#when(Object)}
200 203
     * @since 1.8.0
201 204
     */
202 205
    public static <T> BDDMyOngoingStubbing<T> given(T methodCall) {
@@ -344,7 +347,7 @@
Loading
344 347
     * See original {@link Stubber}
345 348
     * @since 1.8.0
346 349
     */
347 -
    public interface BDDStubber {
350 +
    public interface BaseBDDStubber {
348 351
        /**
349 352
         * See original {@link Stubber#doAnswer(Answer)}
350 353
         * @since 1.8.0
@@ -413,7 +416,13 @@
Loading
413 416
         * @since 1.9.0
414 417
         */
415 418
        BDDStubber willCallRealMethod();
419 +
    }
416 420
421 +
    /**
422 +
     * See original {@link Stubber}
423 +
     * @since 1.8.0
424 +
     */
425 +
    public interface BDDStubber extends BaseBDDStubber {
417 426
        /**
418 427
         * See original {@link Stubber#when(Object)}
419 428
         * @since 1.8.0
@@ -482,23 +491,140 @@
Loading
482 491
    }
483 492
484 493
    /**
485 -
     * see original {@link Mockito#doThrow(Throwable[])}
494 +
     * See original {@link org.mockito.stubbing.LenientStubber}
495 +
     *
496 +
     * @since 1.8.0
497 +
     */
498 +
    public interface BDDLenientStubber extends BaseBDDStubber {
499 +
500 +
        /**
501 +
         * See original {@link org.mockito.stubbing.LenientStubber#when(Object)}
502 +
         *
503 +
         * @since 3.5.16
504 +
         */
505 +
        <T> BDDMyOngoingStubbing<T> given(T mock);
506 +
    }
507 +
508 +
    private static class BDDLenientStubberImpl implements BDDLenientStubber {
509 +
510 +
        private LenientStubber mockitoStubber;
511 +
512 +
        public BDDLenientStubberImpl(LenientStubber stubber) {
513 +
            this.mockitoStubber = stubber;
514 +
        }
515 +
516 +
        /**
517 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doAnswer(Answer)}
518 +
         * @since 3.5.16
519 +
         */
520 +
        public BDDStubber willAnswer(Answer<?> answer) {
521 +
            return new BDDStubberImpl(mockitoStubber.doAnswer(answer));
522 +
        }
523 +
524 +
        /**
525 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doAnswer(Answer)}
526 +
         * @since 3.5.16
527 +
         */
528 +
        public BDDStubber will(Answer<?> answer) {
529 +
            return new BDDStubberImpl(mockitoStubber.doAnswer(answer));
530 +
        }
531 +
532 +
        /**
533 +
         * @deprecated please use {@link #willDoNothing()} instead
534 +
         */
535 +
        @Deprecated
536 +
        public BDDStubber willNothing() {
537 +
            return willDoNothing();
538 +
        }
539 +
540 +
        /**
541 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doNothing()}
542 +
         * @since 3.5.16
543 +
         */
544 +
        public BDDStubber willDoNothing() {
545 +
            return new BDDStubberImpl(mockitoStubber.doNothing());
546 +
        }
547 +
548 +
        /**
549 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doAnswer(Answer)}
550 +
         * @since 3.5.16
551 +
         */
552 +
        public BDDStubber willReturn(Object toBeReturned) {
553 +
            return new BDDStubberImpl(mockitoStubber.doReturn(toBeReturned));
554 +
        }
555 +
556 +
        /**
557 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doReturn(Object, Object...)}
558 +
         * @since 3.5.16
559 +
         */
560 +
        public BDDStubber willReturn(Object toBeReturned, Object... nextToBeReturned) {
561 +
            return new BDDStubberImpl(mockitoStubber.doReturn(toBeReturned, nextToBeReturned));
562 +
        }
563 +
564 +
        /**
565 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doThrow(Throwable...)}
566 +
         * @since 3.5.16
567 +
         */
568 +
        public BDDStubber willThrow(Throwable... toBeThrown) {
569 +
            return new BDDStubberImpl(mockitoStubber.doThrow(toBeThrown));
570 +
        }
571 +
572 +
        /**
573 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doThrow(Class)}
574 +
         * @since 3.5.16
575 +
         */
576 +
        public BDDStubber willThrow(Class<? extends Throwable> toBeThrown) {
577 +
            return new BDDStubberImpl(mockitoStubber.doThrow(toBeThrown));
578 +
        }
579 +
580 +
        /**
581 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doThrow(Class, Class[])}
582 +
         * @since 3.5.16
583 +
         */
584 +
        public BDDStubber willThrow(
585 +
                Class<? extends Throwable> toBeThrown,
586 +
                Class<? extends Throwable>... nextToBeThrown) {
587 +
            return new BDDStubberImpl(mockitoStubber.doThrow(toBeThrown, nextToBeThrown));
588 +
        }
589 +
590 +
        /**
591 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#doCallRealMethod()}
592 +
         * @since 3.5.16
593 +
         */
594 +
        public BDDStubber willCallRealMethod() {
595 +
            return new BDDStubberImpl(mockitoStubber.doCallRealMethod());
596 +
        }
597 +
598 +
        /**
599 +
         * See original {@link org.mockito.internal.stubbing.DefaultLenientStubber#when(Object)}
600 +
         * @since 3.5.16
601 +
         */
602 +
        @Override
603 +
        public <T> BDDMyOngoingStubbing<T> given(T mock) {
604 +
            OngoingStubbingImpl<T> ongoingStubbing = (OngoingStubbingImpl) Mockito.when(mock);
605 +
            ongoingStubbing.setStrictness(Strictness.LENIENT);
606 +
            return new BDDOngoingStubbingImpl<T>(ongoingStubbing);
607 +
        }
608 +
    }
609 +
610 +
    /**
611 +
     * See original {@link Mockito#doThrow(Throwable[])}
486 612
     * @since 2.1.0
487 613
     */
488 614
    public static BDDStubber willThrow(Throwable... toBeThrown) {
489 615
        return new BDDStubberImpl(Mockito.doThrow(toBeThrown));
490 616
    }
491 617
492 618
    /**
493 -
     * see original {@link Mockito#doThrow(Class)}
619 +
     * See original {@link Mockito#doThrow(Class)}
494 620
     * @since 1.9.0
495 621
     */
496 622
    public static BDDStubber willThrow(Class<? extends Throwable> toBeThrown) {
497 623
        return new BDDStubberImpl(Mockito.doThrow(toBeThrown));
498 624
    }
499 625
500 626
    /**
501 -
     * see original {@link Mockito#doThrow(Class)}
627 +
     * See original {@link Mockito#doThrow(Class)}
502 628
     * @since 1.9.0
503 629
     */
504 630
    public static BDDStubber willThrow(
@@ -507,39 +633,39 @@
Loading
507 633
    }
508 634
509 635
    /**
510 -
     * see original {@link Mockito#doAnswer(Answer)}
636 +
     * See original {@link Mockito#doAnswer(Answer)}
511 637
     * @since 1.8.0
512 638
     */
513 639
    public static BDDStubber willAnswer(Answer<?> answer) {
514 640
        return new BDDStubberImpl(Mockito.doAnswer(answer));
515 641
    }
516 642
517 643
    /**
518 -
     * see original {@link Mockito#doAnswer(Answer)}
644 +
     * See original {@link Mockito#doAnswer(Answer)}
519 645
     * @since 2.1.0
520 646
     */
521 647
    public static BDDStubber will(Answer<?> answer) {
522 648
        return new BDDStubberImpl(Mockito.doAnswer(answer));
523 649
    }
524 650
525 651
    /**
526 -
     * see original {@link Mockito#doNothing()}
652 +
     * See original {@link Mockito#doNothing()}
527 653
     * @since 1.8.0
528 654
     */
529 655
    public static BDDStubber willDoNothing() {
530 656
        return new BDDStubberImpl(Mockito.doNothing());
531 657
    }
532 658
533 659
    /**
534 -
     * see original {@link Mockito#doReturn(Object)}
660 +
     * See original {@link Mockito#doReturn(Object)}
535 661
     * @since 1.8.0
536 662
     */
537 663
    public static BDDStubber willReturn(Object toBeReturned) {
538 664
        return new BDDStubberImpl(Mockito.doReturn(toBeReturned));
539 665
    }
540 666
541 667
    /**
542 -
     * see original {@link Mockito#doReturn(Object, Object...)}
668 +
     * See original {@link Mockito#doReturn(Object, Object...)}
543 669
     * @since 2.1.0
544 670
     */
545 671
    @SuppressWarnings({"unchecked", "varargs"})
@@ -548,10 +674,21 @@
Loading
548 674
    }
549 675
550 676
    /**
551 -
     * see original {@link Mockito#doCallRealMethod()}
677 +
     * See original {@link Mockito#doCallRealMethod()}
552 678
     * @since 1.8.0
553 679
     */
554 680
    public static BDDStubber willCallRealMethod() {
555 681
        return new BDDStubberImpl(Mockito.doCallRealMethod());
556 682
    }
683 +
684 +
    /**
685 +
     * Due to conflict with the original method {@link Mockito#lenient()}, this method has to break naming consistency
686 +
     * (issue <a href="https://github.com/mockito/mockito/pull/2048">#2048</a>)
687 +
     *
688 +
     * See original {@link Mockito#lenient()}
689 +
     * @since 3.5.16
690 +
     */
691 +
    public static BDDLenientStubber leniently() {
692 +
        return new BDDLenientStubberImpl(Mockito.lenient());
693 +
    }
557 694
}

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Complexity Coverage
src/main/java/org/mockito +1.00% 85.55% +<.01% 84.79%
subprojects 79.06% 85.34%
Project Totals (325 files) 85.46% 84.80%
Loading