This repository houses the standalone TestNG assertion library: org.testng.Assert,
org.testng.asserts.SoftAssert and the related assertion classes.
These classes were historically bundled inside the main org.testng:testng artifact. They now
live here and are published as the standalone org.testng:testng-asserts artifact so they can
evolve and be released independently.
- JDK 11 (or higher)
org.testng.Assert delegates the behaviour-identical assertions (assertNull/assertNotNull/
assertSame/assertNotSame, assertThrows) to AssertJ, so
assertj-core is the only runtime dependency (brought transitively). TestNG is required at test
scope only (to run the assertion tests via the TestNG runner).
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng-asserts</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>If you previously relied on org.testng.Assert / org.testng.asserts.* coming transitively from
org.testng:testng, add org.testng:testng-asserts explicitly.
For new code or larger refactoring efforts, AssertJ is recommended. See docs/MIGRATING_ASSERTIONS.md for the migration guide, including the automated OpenRewrite recipe.
./mvnw clean testArtifacts are published to Maven Central through the Central Portal, using two workflows.
The deploy.yml workflow runs on every push to main and publishes the current
-SNAPSHOT version to the Central Portal snapshot repository. It is guarded to only
deploy when the project version ends with -SNAPSHOT, so release commits pushed to
main are skipped (no double publish).
The release.yml workflow performs a release on demand. From the GitHub
Actions tab, select Release → Run workflow and optionally provide:
releaseVersion— the version to release (e.g.1.0.0). Defaults to the current version without-SNAPSHOT.nextVersion— the next development version (e.g.1.0.1-SNAPSHOT). Defaults to the release patch + 1 with-SNAPSHOT.
The workflow then sets the release version, builds and verifies, deploys the release
to Maven Central (staged and auto-published), commits and pushes the vX.Y.Z tag,
creates a matching GitHub Release with auto-generated notes, and finally bumps the
version back to the next -SNAPSHOT on main.
Remember to move the relevant entries from the [Unreleased] section of
CHANGELOG.md into a new version section before releasing.
The following repository (or organization) secrets must be configured:
MAVEN_USERNAME/MAVEN_PASSWORD— a Central Portal user token (Account → Generate User Token). These are not the legacy OSSRH credentials.GPG_PRIVATE_KEY— the ASCII-armored GPG private key used to sign artifacts.GPG_PASSPHRASE— the passphrase for that key.