kotest-behaviorspec

Creates Kotest BehaviorSpec-style Kotlin tests for Spring Boot applications with Testcontainers and MockMvc.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/spandios/vibe-utils --skill kotest-behaviorspec
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: kotest-behaviorspec
Source: https://github.com/spandios/vibe-utils/tree/main/skills/kotest-behaviorspec
Command: npx skills add https://github.com/spandios/vibe-utils --skill kotest-behaviorspec

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and patterns for writing tests in Kotlin using the Kotest BehaviorSpec style, specifically tailored for Spring Boot applications. It aims to streamline the process of creating robust unit, integration, and end-to-end tests.

Core Features & Use Cases

  • BehaviorSpec Structure: Learn how to structure tests using given, when, then for BDD-style testing.
  • Spring Boot Integration: Examples for testing repositories, services, and controllers with Spring Boot.
  • Testcontainers: Demonstrates integration with Testcontainers for database and other external service testing.
  • MockMvc: Provides patterns for end-to-end testing of REST APIs.
  • Kotest Matchers: Includes a cheatsheet for common assertion matchers.

Quick Start

Use the kotest-behaviorspec skill to generate a basic BehaviorSpec test for a Spring Boot service that fetches user data.

Frequently Asked Questions about kotest-behaviorspec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write BDD-style tests for Kotlin Spring Boot applications?โ–ผ

BDD-style tests for Kotlin Spring Boot applications can be written using the Kotest BehaviorSpec style, structuring tests with given, when, then blocks to cover repository, service, and E2E patterns.

What is the best way to integrate Testcontainers with Kotest BehaviorSpec?โ–ผ

Kotest BehaviorSpec integrates with Testcontainers for integration testing by applying standard BDD blocks to orchestrate container lifecycle and test external database services within Spring Boot applications.

How do I test REST APIs using MockMvc with Kotest in a Spring Boot application?โ–ผ

You can test REST APIs using MockMvc with Kotest by utilizing BehaviorSpec patterns designed for end-to-end controller testing, validating API responses using common Kotest matchers.

Can I use Kotest BehaviorSpec for testing Spring Boot repositories and services?โ–ผ

Yes, Kotest BehaviorSpec supports testing Spring Boot repositories and services by providing structured BDD patterns that validate data layer logic and service behaviors using Kotest matchers.

What Kotest matchers are available for assertion in BehaviorSpec tests?โ–ผ

Kotest BehaviorSpec tests utilize common assertion matchers provided in a cheatsheet format, allowing you to validate outcomes across repository, service, and E2E testing layers in Spring Boot.