Examples
The examples/ directory contains complete
example projects covering different build tools, test frameworks, and notification platforms.
Example Projects
| Directory | Build Tool | Test Framework | Notifier | Language |
|---|---|---|---|---|
| gradle-junit-slack | Gradle (Kotlin DSL) | JUnit 6 | Slack | Kotlin |
| gradle-kotest-teams | Gradle (Kotlin DSL) | Kotest | Teams | Kotlin |
| maven-junit-discord | Maven | JUnit 6 | Discord | Java |
| maven-testng-slack | Maven | TestNG | Slack | Java |
What Each Example Demonstrates
gradle-junit-slack (Kotlin)
Shows JUnit 6 integration with the Slack notifier using Gradle. Demonstrates @ExtendWith(MessageExtension::class),
@Slack, @Message.Events, @Message.Template, and the programmatic RunWith.messageOnException() API.
gradle-kotest-teams (Kotlin)
Shows all three Kotest integration approaches with the Teams notifier:
- Spec-level annotations (
AlerticornExtension) on anAnnotationSpec - Per-test DSL using
alerticornTest()andalerticorn()builder on aFunSpec - Project-level notifications via
AlerticornProjectExtensioninProjectConfig
maven-junit-discord (Java)
Shows JUnit 6 integration with the Discord notifier using Maven. Demonstrates the same annotation
patterns as gradle-junit-slack but in Java, including the RunWith.message() programmatic API
with BiFunction and Supplier.
maven-testng-slack (Java)
Shows TestNG integration with the Slack notifier using Maven. Demonstrates @Listeners(MessageListener.class),
method-level @Message annotations, and suite-level notifications with @Message.Events({Event.SUITE_COMPLETE}).
Webhook Configuration
Each example contains a placeholder webhook URL. See the examples README and the Configuration page for details on setting up webhook URLs safely using environment variables.
Mattermost
Mattermost is compatible with the Slack notifier. See the Mattermost notifier documentation and the examples README for details.