New advertisers: 50% off your first month with code FIRSTMONTHSee slots
giuseppe-trisciuoglio avatar

Unit Test Config Properties

Patterns for unit testing @ConfigurationProperties binding, validation, defaults, and type conversion without full context startup.

skills.sh installs
3.9K
GitHub stars
372
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers property binding, validation constraints, default values, type conversions, and nested or profile-specific configuration structures
  • Includes runnable JUnit 5 examples built on ApplicationContextRunner, with @Validated failure checks and Duration, DataSize, list, and map conversions
  • Guides troubleshooting for prefix mismatches, kebab-case to camelCase mapping, and missing @Validated annotations
  • Designed for Spring Boot projects that need fast configuration tests and checks of YAML or application.properties bindings

Install

$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill unit-test-config-properties -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Unit Testing Configuration Properties and Profiles

Overview

This skill provides patterns for unit testing @ConfigurationProperties bindings, environment-specific configurations, and property validation using JUnit 5. Covers testing property name mapping, type conversions, validation constraints, nested structures, and profile-specific configurations without full Spring context startup.

Key validation checkpoints:

  • Property prefix matches between @ConfigurationProperties and test properties
  • Validation triggers on @Validated classes with invalid values
  • Type conversions work for Duration, DataSize, collections, and maps

When to Use

  • Testing @ConfigurationProperties property binding
  • Testing property name mapping and type conversions
  • Validating configuration with @NotBlank, @Min, @Max, @Email constraints
  • Testing environment-specific configurations (dev, prod)
  • Testing nested property structures and collections
  • Verifying default values when properties are not specified
  • Fast configuration tests without Spring context startup

Instructions

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Categories
Testing & QA, Java & JVM
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 95

Similar to Unit Test Config Properties

More Testing & QA