Test Spring @ConfigurationProperties bindings, validation, and type conversions without full context startup.
Works with
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
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionunit-test-config-propertiesExecute 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.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
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.
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.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
194
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
194
stars
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:
@ConfigurationProperties and test properties@Validated classes with invalid values@ConfigurationProperties property binding@NotBlank, @Min, @Max, @Email constraintsspring-boot-starter-test and AssertJ dependencies@ConfigurationProperties(prefix = "...") matches test property pathscontext.hasFailed() to verify @Validated properties reject invalid values30s), DataSize (50MB), collections, and maps convert correctly@Profile with ApplicationContextRunner for environment-specific configurationsTroubleshooting flow:
@Validated annotation is present@ConfigurationProperties class structure<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>
@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();
});
}
}
@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"
)
.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
20giuseppe-trisciuoglio/developer-kit
Frontendsame reponextjs-code-review
8giuseppe-trisciuoglio/developer-kit
Frontendsame repodrizzle-orm-patterns
7giuseppe-trisciuoglio/developer-kit
Productivitysame reponestjs-best-practices
7giuseppe-trisciuoglio/developer-kit
Productivitysame repograalvm-native-image
4giuseppe-trisciuoglio/developer-kit
Productivitysame repotest-cases
21cexll/myclaude
Testingtag: testReviews
4.8★★★★★36 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
1 / 4Discussion
Comments — not star reviews- No comments yet — start the thread.