unit-test-config-properties

Test Spring @ConfigurationProperties bindings, validation, and type conversions without full context startup.

Works with

Claude CodeCursorClineWindsurfCodexGooseGitHub CopilotZed

0

total installs

0

this week

194

GitHub stars

0

upvotes

Install Skill

Run in your terminal

$npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-config-properties

0

installs

0

this week

194

stars

What it does

  • Use ApplicationContextRunner to test property binding in isolation, covering simple properties, nested structures, collections, and type conversions

  • Verify validation constraints with @Validated annotations, ensuring invalid values fail appropriately and valid configurations pass

  • Test default values, profile-specific configurations, and property name mapping (kebab-case to ca

Category

Testing

Last updated

Apr 8, 2026

Installation Guide

How to use unit-test-config-properties on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your machine
  • Node.js 16+ with npm — verify with node --version
  • Active project directory where you want to add unit-test-config-properties
2

Run the install command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-config-properties

Fetches unit-test-config-properties from giuseppe-trisciuoglio/developer-kit and configures it for Cursor.

3

Select Cursor when prompted

The CLI shows a list of agents. Use arrow keys and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ────────────────
│ · Cline · Codex · Goose · Windsurf
│ ●Cursor(selected)
│ · Cursor · Aider · Continue
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/unit-test-config-properties

Restart Cursor to activate unit-test-config-properties. Access via /unit-test-config-properties in your agent's command palette.

Security Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.

Documentation

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

  1. Set up test dependencies: Add spring-boot-starter-test and AssertJ dependencies
  2. Use ApplicationContextRunner: Test property bindings without starting full Spring context
  3. Define property prefixes: Ensure @ConfigurationProperties(prefix = "...") matches test property paths
  4. Test all property paths: Verify each property including nested structures and collections
  5. Test validation constraints: Use context.hasFailed() to verify @Validated properties reject invalid values
  6. Test type conversions: Verify Duration (30s), DataSize (50MB), collections, and maps convert correctly
  7. Test default values: Verify properties have correct defaults when not specified in test properties
  8. Test profile-specific configs: Use @Profile with ApplicationContextRunner for environment-specific configurations
  9. Test edge cases: Include empty strings, null values, and type mismatches

Troubleshooting flow:

  • If properties don't bind → Check prefix matches (kebab-case to camelCase conversion)
  • If validation doesn't trigger → Verify @Validated annotation is present
  • If context fails to start → Check dependencies and @ConfigurationProperties class structure

Examples

Setup: Test Dependencies

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-configuration-processor</artifactId>
  <scope>provided</scope>
</dependency>
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.assertj</groupId>
  <artifactId>assertj-core</artifactId>
  <scope>test</scope>
</dependency>

Basic Pattern: Property Binding

@ConfigurationProperties(prefix = "app.security")
@Data
public class SecurityProperties {
  private String jwtSecret;
  private long jwtExpirationMs;
  private int maxLoginAttempts;
  private boolean enableTwoFactor;
}

class SecurityPropertiesTest {

  @Test
  void shouldBindPropertiesFromEnvironment() {
    new ApplicationContextRunner()
      .withPropertyValues(
        "app.security.jwtSecret=my-secret-key",
        "app.security.jwtExpirationMs=3600000",
        "app.security.maxLoginAttempts=5",
        "app.security.enableTwoFactor=true"
      )
      .withBean(SecurityProperties.class)
      .run(context -> {
        SecurityProperties props = context.getBean(SecurityProperties.class);
        assertThat(props.getJwtSecret()).isEqualTo("my-secret-key");
        assertThat(props.getJwtExpirationMs()).isEqualTo(3600000L);
        assertThat(props.getMaxLoginAttempts()).isEqualTo(5);
        assertThat(props.isEnableTwoFactor()).isTrue();
      });
  }

  @Test
  void shouldUseDefaultValuesWhenPropertiesNotProvided() {
    new ApplicationContextRunner()
      .withPropertyValues("app.security.jwtSecret=key")
      .withBean(SecurityProperties.class)
      .run(context -> {
        SecurityProperties props = context.getBean(SecurityProperties.class);
        assertThat(props.getJwtSecret()).isEqualTo("key");
        assertThat(props.getMaxLoginAttempts()).isZero();
      });
  }
}

Validation Testing

@ConfigurationProperties(prefix = "app.server")
@Data
@Validated
public class ServerProperties {
  @NotBlank
  private String host;

  @Min(1)
  @Max(65535)
  private int port = 8080;

  @Positive
  private int threadPoolSize;
}

class ConfigurationValidationTest {

  @Test
  void shouldFailValidationWhenHostIsBlank() {
    new ApplicationContextRunner()
      .withPropertyValues(
        "app.server.host=",
        "app.server.port=8080",
        "app.server.threadPoolSize=10"
      )
      .withBean(ServerProperties.class)
      .run(context -> {
        assertThat(context).hasFailed()
          .getFailure()
          .hasMessageContaining("host");
      });
  }

  @Test
  void shouldPassValidationWithValidConfiguration() {
    new ApplicationContextRunner()
      .withPropertyValues(
        "app.server.host=localhost",
        "app.server.port=8080",
        "app.server.threadPoolSize=10"
      )
      .

List & Monetize Your Skill

Submit your Claude Code skill and start earning

Get started →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Steps

  1. 1Install skill using provided installation command
  2. 2Test with simple use case relevant to your work
  3. 3Evaluate output quality and relevance
  4. 4Iterate on prompts to improve results
  5. 5Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use when

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid when

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Related Skills

Reviews

4.836 reviews
  • P
    Pratham WareDec 20, 2024

    I recommend unit-test-config-properties for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • A
    Aanya ThomasDec 16, 2024

    unit-test-config-properties reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • L
    Luis AndersonDec 12, 2024

    unit-test-config-properties is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Y
    Yash ThakkerNov 11, 2024

    Useful defaults in unit-test-config-properties — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • A
    Ama OkaforNov 7, 2024

    unit-test-config-properties is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • E
    Emma BhatiaNov 3, 2024

    unit-test-config-properties reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • C
    Chinedu OkaforOct 26, 2024

    Useful defaults in unit-test-config-properties — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • A
    Anika SmithOct 22, 2024

    I recommend unit-test-config-properties for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • D
    Dhruvi JainOct 2, 2024

    unit-test-config-properties is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • P
    Piyush GSep 13, 2024

    unit-test-config-properties fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

showing 1-10 of 36

1 / 4

Discussion

Comments — not star reviews
  • No comments yet — start the thread.