https://github.com/testng-team/testng-asserts
https://github.com/testng-team/testng-asserts
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/testng-team/testng-asserts
- Owner: testng-team
- License: apache-2.0
- Created: 2026-06-23T18:33:08.000Z (18 days ago)
- Default Branch: main
- Last Pushed: 2026-06-30T10:14:27.000Z (11 days ago)
- Last Synced: 2026-06-30T12:12:24.447Z (11 days ago)
- Language: Java
- Size: 112 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# TestNG Asserts
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.
## Pre-requisites
* JDK 11 (or higher)
`org.testng.Assert` delegates the behaviour-identical assertions (`assertNull`/`assertNotNull`/
`assertSame`/`assertNotSame`, `assertThrows`) to [AssertJ](https://assertj.github.io/doc/), 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).
## Usage
```xml
org.testng
testng-asserts
1.0.0
test
```
## Migration
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](https://assertj.github.io/doc/) is recommended.
See [docs/MIGRATING_ASSERTIONS.md](docs/MIGRATING_ASSERTIONS.md) for the migration guide, including
the automated OpenRewrite recipe.
## Building
```bash
./mvnw clean test
```
## Releasing
Artifacts are published to Maven Central through the
[Central Portal](https://central.sonatype.com/), using two workflows.
### Snapshots (automatic)
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).
### Releases (manual)
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`](CHANGELOG.md) into a new version section before releasing.
### Required secrets
The following repository (or organization) secrets must be configured:
* `MAVEN_USERNAME` / `MAVEN_PASSWORD` — a [Central Portal user token](https://central.sonatype.com/account)
(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.