unit-test-config-properties
Test Spring @ConfigurationProperties bindings, validation, and type conversions without full context startup.
Works with
0
total installs
0
this week
194
GitHub stars
0
upvotes
Install Skill
Run in your terminal
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
Installation Guide
How to use unit-test-config-properties on Cursor
AI-first code editor with Composer
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
Run the install command
Execute the skills CLI command in your project's root directory to begin installation:
Fetches unit-test-config-properties from giuseppe-trisciuoglio/developer-kit and configures it for Cursor.
Select Cursor when prompted
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
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
@ConfigurationPropertiesand test properties - Validation triggers on
@Validatedclasses with invalid values - Type conversions work for Duration, DataSize, collections, and maps
When to Use
- Testing
@ConfigurationPropertiesproperty binding - Testing property name mapping and type conversions
- Validating configuration with
@NotBlank,@Min,@Max,@Emailconstraints - 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
- Set up test dependencies: Add
spring-boot-starter-testand AssertJ dependencies - Use ApplicationContextRunner: Test property bindings without starting full Spring context
- Define property prefixes: Ensure
@ConfigurationProperties(prefix = "...")matches test property paths - Test all property paths: Verify each property including nested structures and collections
- Test validation constraints: Use
context.hasFailed()to verify@Validatedproperties reject invalid values - Test type conversions: Verify Duration (
30s), DataSize (50MB), collections, and maps convert correctly - Test default values: Verify properties have correct defaults when not specified in test properties
- Test profile-specific configs: Use
@ProfilewithApplicationContextRunnerfor environment-specific configurations - 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
@Validatedannotation is present - If context fails to start → Check dependencies and
@ConfigurationPropertiesclass 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
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 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
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
tailwind-css-patterns
16giuseppe-trisciuoglio/developer-kit
nextjs-code-review
8giuseppe-trisciuoglio/developer-kit
nestjs-best-practices
6giuseppe-trisciuoglio/developer-kit
drizzle-orm-patterns
6giuseppe-trisciuoglio/developer-kit
graalvm-native-image
4giuseppe-trisciuoglio/developer-kit
polyglot-test-agent
11github/awesome-copilot
Reviews
- PPratham Ware★★★★★Dec 20, 2024
I recommend unit-test-config-properties for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- AAanya Thomas★★★★★Dec 16, 2024
unit-test-config-properties reduced setup friction for our internal harness; good balance of opinion and flexibility.
- LLuis Anderson★★★★★Dec 12, 2024
unit-test-config-properties is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- YYash Thakker★★★★★Nov 11, 2024
Useful defaults in unit-test-config-properties — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- AAma Okafor★★★★★Nov 7, 2024
unit-test-config-properties is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- EEmma Bhatia★★★★★Nov 3, 2024
unit-test-config-properties reduced setup friction for our internal harness; good balance of opinion and flexibility.
- CChinedu Okafor★★★★★Oct 26, 2024
Useful defaults in unit-test-config-properties — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- AAnika Smith★★★★★Oct 22, 2024
I recommend unit-test-config-properties for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- DDhruvi Jain★★★★★Oct 2, 2024
unit-test-config-properties is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- PPiyush G★★★★★Sep 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
Discussion
Comments — not star reviews- No comments yet — start the thread.