How joostvanwollingen/alerticorn works
Project Type and Overall Purpose
• Alerticorn is a lightweight Kotlin library that sends notifications when tests (or code blocks) fail. It is designed to be easily integrated with various test frameworks (with built-in JUnit support and planned support for TestNG/Kotest) and supports multiple notification platforms.
• The framework’s core idea is to provide a pluggable notification system where different modules (notifiers) implement the common Notifier interface, and integration modules (like JUnit and TestNG) adapt Alerticorn for specific test runners.
Main Components
a. Core Module:
• This is the heart of Alerticorn (located under the “core” directory). It includes the API definitions (like Notifier, NotificationManager, Message, AlerticornMessage, and ConfigurationManager) and basic functionality.
• That the “Core” defines interfaces and common behaviors upon which other modules rely.
b. Notifier Implementations:
• Notifier modules such as “discord-notifier”, “slack-webhook-notifier”, and “teams-workflow-notifier”. Each provides a concrete implementation of the Notifier interface.
• That these modules register their implementations (via META-INF/services files) so that the core module can discover and use them, which demonstrates the pluggable architecture.
• You might also note that the “docs” directory contains documentation and architectural guidelines, including details about each notifier.
c. Integration/Testing Framework Modules:
• The “junit” module is used to integrate Alerticorn with JUnit (via a JUnit extension) to trigger notifications on test failures.
• The “testng” module indicates planned integration with TestNG.
• Optionally, mention that Kotest integration is “coming soon” as noted in the README.
d. Additional Modules and Artifacts:
• The build files (build.gradle.kts, settings.gradle.kts, gradle directory) indicating that this is a multi-module Gradle project.
• The documentation component (docs) where detailed guidelines, architecture description, and usage examples are available.
Relationships and Interactions
• Dynamic discovery through service loading (point out that each notifier is discovered via the META-INF/services mechanism).
Architectural Patterns and Design Principles
• “Pluggable” architecture pattern where the core exposes a set of interfaces (Notifier, MessageProvider, etc.), and external modules provide specific behaviors.
• Dependency Injection / Service Locator concepts – the system discovers notifier implementations at runtime.
• Mention modularity as a design principle, with clear separation (each notifier in its own module, separate modules for testing integrations).
Additional Elements to Include for Clarity
• Lines between components with annotations like “implements”, “calls”, “invokes on failure”, etc.
• Mention that the service locator pattern is used – you could include a note or an annotation “Service Loader” on the connection lines between “Core” and each individual notifier module.