Tags: mockito/mockito
Tags
Fix StackOverflowError with AbstractList after using mockSingleton (#… …3790) * Fix StackOverflowError when mocking after singleton mock is closed Replace WeakHashMap with a WeakIdentityMap that uses System.identityHashCode and == for key comparison. This avoids calling instrumented hashCode()/equals() methods on mock instances during map lookups, which caused infinite recursion when mocking classes like AbstractList whose hashCode() invokes instrumented methods. * Update mockSingleton already registered exception message --------- Co-authored-by: Joshua Selbo <[email protected]>
Add core API to enable Kotlin singleton mocking (#3762) * Add core API to enable Kotlin singleton mocking Fixes #3652 * Update implementation - no modifying MockSettings API. Entry point is via MockUtil in the internal package. * Fix NPE * Reimplement as mockSingleton API, decouple from static mocking, have docs/tests demonstrate stubbing Java enums * Update javadocs * Update wording of MockedSingleton javadoc --------- Co-authored-by: Joshua Selbo <[email protected]>
Bump graalvm/setup-graalvm from 1.4.3 to 1.4.4 (#3768) Bumps [graalvm/setup-graalvm](https://github.com/graalvm/setup-graalvm) from 1.4.3 to 1.4.4. - [Release notes](https://github.com/graalvm/setup-graalvm/releases) - [Commits](graalvm/setup-graalvm@v1.4.3...v1.4.4) --- updated-dependencies: - dependency-name: graalvm/setup-graalvm dependency-version: 1.4.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add support for generic types in `MockedConstruction` and `MockedStat… …ic` (#3729) MockedStatic and MockedConstruction threw a MockitoException when the provided type was itself parameterized, suggesting to use a raw type instead. For instance, MockedConstruction<MyGenericType<String>> was not allowed. This commit allows to mock generic types without throwing an exception and without forcing users to deal with 'raw use of parameterized class' warnings. Fixes #2401
Add support for JDK21 Sequenced Collections. (#3708) JEP 431 introduced new Sequenced Collection interfaces in JDK 21. Previously, unstubbed methods returning these types would result in null. This changes allow Mockito appropriate empty collections (e.g. ArrayList for SequencedCollection) while maintaining the Java 11 baseline compatability. Fixes #3659 Signed-off-by: BeomSeogKim <[email protected]>
Fix javadoc publication (#3561) There are a couple of fixes included in this commit: * The destination dir was improperly set when translating from groovy DSL to kotlin DSL in 590b24a which prevented the cache and the javadocJar to pick up the right folder. This change avoids setting manually the destination dir and uses the default instead. * Skip test-fixtures publication * Always publish javadoc artifact for published modules * In 2c184c9 nexus publish was bumped to 2.0.1, however a task changed name. while this didn't prevent the task to be executed, let's use the correct name. * Exclude internal packages Fixes #3542
PreviousNext