Skip to main content

Examples

The examples/ directory contains complete example projects covering different build tools, test frameworks, and notification platforms.

Example Projects

DirectoryBuild ToolTest FrameworkNotifierLanguage
gradle-junit-slackGradle (Kotlin DSL)JUnit 6SlackKotlin
gradle-kotest-teamsGradle (Kotlin DSL)KotestTeamsKotlin
maven-junit-discordMavenJUnit 6DiscordJava
maven-testng-slackMavenTestNGSlackJava

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 an AnnotationSpec
  • Per-test DSL using alerticornTest() and alerticorn() builder on a FunSpec
  • Project-level notifications via AlerticornProjectExtension in ProjectConfig

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.