commit | f522f49874b1abf80d209447fe2b4d542f884587 | [log] [tgz] |
---|---|---|
author | ascopes <73482956+ascopes@users.noreply.github.com> | Sun Oct 29 18:26:22 2023 |
committer | GitHub <noreply@github.com> | Sun Oct 29 18:26:22 2023 |
tree | 062128c6ce16f8660c4d6db578fabd94da9e71f4 | |
parent | a8adbf5027bfc295b002e5d87120e7c0d1229f96 [diff] |
Attempt to detect system property mangling prior to loading ByteBuddy. (#3164) If the user stubs their System properties (e.g. to test code that handles System properties to determine the platform), then they may unexpectedly hit the issue that ByteBuddy will attempt to fork a subprocess upon being installed, and that relies on the JVM Process class. Internally, the Process class makes a call to 'System.getProperty(os.name)', which results in a NullPointerException being raised if the property does not exist. When this exception occurs, it bubbles up to Mockito in the shape of a very confusing error message, which we should ideally try to avoid. This change adds a check for this edge case prior to loading ByteBuddy so that a meaningful error message can be raised that instructs the user on how to mitigate this issue.
Most popular mocking framework for Java
Still on Mockito 1.x? See what's new in Mockito 2! Mockito 3 does not introduce any breaking API changes, but now requires Java 8 over Java 6 for Mockito 2. Mockito 4 removes deprecated API. Mockito 5 switches the default mockmaker to mockito-inline, and now requires Java 11. Only one major version is supported at a time, and changes are not backported to older versions.
Available as part of the Tidelift Subscription.
The maintainers of org.mockito:mockito-core and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
Mockito publishes every change as a -SNAPSHOT
version to a public Sonatype repository. Roughly once a month, we publish a new minor or patch version to Maven Central. For release automation we use Shipkit library (http://shipkit.org), Gradle Nexus Publish Plugin. Fully automated releases are awesome, and you should do that for your libraries, too! See the latest release notes and latest documentation. Docs in javadoc.io are available 24h after release. Read also about semantic versioning in Mockito.
Older 1.x and 2.x releases are available in Central Repository and javadoc.io (documentation).
All you want to know about Mockito is hosted at The Mockito Site which is Open Source and likes pull requests, too.
Want to contribute? Take a look at the Contributing Guide.
Enjoy Mockito!
To build locally:
./gradlew build
To develop in IntelliJ IDEA you can use built-in Gradle import wizard in IDEA. Alternatively generate the importable IDEA metadata files using:
./gradlew idea
Then, open the generated *.ipr file in IDEA.
-SNAPSHOT
version to Sonatype snapshot repo at https://s01.oss.sonatype.org/content/repositories/snapshots/org/mockito/mockito-core.git tag -a -m "Release 3.4.5" v3.4.5 git push origin v3.4.5