JsonUnit is a mature Java library for comparing JSON documents in unit and integration tests. It provides a unified comparison engine with pluggable JSON library backends (Jackson 2/3, Gson, Moshi, Johnzon, org.json) via SPI, and integrates with major testing frameworks: AssertJ, Hamcrest, Spring MVC (MockMvc, WebTestClient, RestTestClient), and Kotest. The core engine supports sophisticated features like placeholder tokens, regex-based path matchers, custom number tolerances, array order ignoring, and path-specific configuration overrides. Its architecture is centered around a clean Node abstraction over various JSON representations, enabling transparent cross-backend support without requiring users to manage parser-specific APIs. Beyond basic equality checking, JsonUnit offers a rich set of options for tolerance, ignoring extra fields, treating null as absent, and fail-fast behavior. The Configuration object is an immutable builder that can be shared and reused across tests. The library also includes Kotlin DSLs for AssertJ and Spring integrations, providing a fluent and type-safe assertion experience. Its multi-module Maven project separates concerns cleanly, and the extensive abstract test base ensures consistent behavior across all supported JSON libraries and assertion APIs. JsonUnit is widely adopted (over 1000 GitHub stars) and actively maintained, with recent updates supporting Java 21+, Jackson 3, and modern Spring versions.
Kotest is a multiplatform Kotlin testing framework that provides a rich DSL for defining tests in multiple spec styles (FunSpec, DescribeSpec, StringSpec, etc.), a comprehensive assertion library with over 200 matchers, property-based testing with arbitrary generators and shrinking, data-driven testing with tables, and a powerful extension system for lifecycle hooks and integrations (Spring, Testcontainers, Allure, MockServer). The framework runs on JVM, JS, Native, Wasm, and Android via custom test engines (JUnit5/6) and includes an IntelliJ plugin for gutter icons and test navigation. The architecture centers on a test execution engine with interceptors chaining around specs and test cases, configurable via project-level and spec-level configuration objects. Property testing uses composable `Arb` generators and `Exhaustive` enumerations with automatic shrinking and coverage statistics. Assertions follow a `Matcher<T>` pattern with extensible equality via the `Eq` typeclass. The build system uses Gradle convention plugins for consistent multiplatform publishing. Key entry points include `TestEngineLauncher`, spec style root scopes (e.g., `FunSpecRootScope`), and the `should`/`shouldNot` assertion DSL. Data flows: source code → test definitions → materialization → interceptor pipeline → execution → listener notifications → JUnit/compatible output. The framework is self-testing, using its own DSL for a large test suite.