marketplace/bundles/pm-dev-java-cui/skills/cui-testing/SKILL.md
CUI test library standards for test data generation, value object contracts, and JUL log testing
npx skillsauth add cuioss/plan-marshall cui-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
REFERENCE MODE: This skill provides reference material. Load specific standards on-demand based on current task.
CUI-specific testing standards for projects using CUI test libraries. This skill covers the mandatory test data generator framework, value object contract testing, and JUL log testing utilities.
Execution mode: Reference library; load standards progressively based on current testing task.
Prohibited actions:
Constraints:
@EnableGeneratorController annotationShouldHandleObjectContracts<T> contract interface@EnableTestLogger and LogAsserts@GeneratorsSource with typed generatorsThis skill requires CUI test library dependencies:
de.cuioss.test:cui-test-generator (Generators, TypedGenerator)de.cuioss.test:cui-test-value-objects (ShouldHandleObjectContracts)de.cuioss.test:cui-test-juli (EnableTestLogger, LogAsserts)CRITICAL: Load this standard for any test implementation work.
Read: standards/test-generator-framework.md
This provides the foundational rules:
Generators.* for ALL test data@EnableGeneratorController annotationValue Object Testing (load for domain object tests):
Read: standards/testing-value-objects.md
Use when: Testing value objects, implementing equals/hashCode contracts, or using ShouldHandleObjectContracts<T>.
JUL Log Testing (load for log verification tests):
Read: standards/testing-juli-logger.md
Use when: Testing code that uses CUI logging and needs to verify log output with @EnableTestLogger and LogAsserts.
// CORRECT - Use Generators
@EnableGeneratorController
class MyServiceTest {
@Test
void shouldProcess() {
String input = Generators.nonEmptyStrings().next();
// ...
}
}
// FORBIDDEN - Never use manual data or Random
String input = "test"; // WRONG
String input = UUID.randomUUID().toString(); // WRONG
// CORRECT - Use @GeneratorsSource
@ParameterizedTest
@GeneratorsSource(EmailGenerator.class)
void shouldValidateEmail(String email) {
// Test with generated emails
}
// Implements automatic contract testing
class PersonTest implements ShouldHandleObjectContracts<Person> {
@Override
public Person getUnderTest() {
return new PersonGenerator().next();
}
}
@EnableTestLogger
class MyServiceTest {
@Test
void shouldLogWarning() {
// Execute code that logs
service.processWithWarning();
// Verify log output
LogAsserts.assertLogMessagePresentContaining(TestLogLevel.WARN, "expected message");
}
}
| Library | Reason | Alternative |
|---------|--------|-------------|
| Mockito | Use CUI framework alternatives | EasyMock for simple mocking, cui-test-mockwebserver-junit5 for HTTP |
| PowerMock | Refactor to dependency injection | EasyMock or CUI test patterns |
When encountering Mockito in existing CUI code:
when().thenReturn() with EasyMock equivalents or dependency injectioncui-test-mockwebserver-junit5 for HTTP client testingpm-dev-java-cui:cui-http-testing for MockWebServer patternsplan-marshall:dev-general-module-testing - Language-agnostic testing principles (AAA, coverage, reliability)pm-dev-java:junit-core - General JUnit 5 patterns (no CUI dependencies)pm-dev-java-cui:cui-logging - CUI logging standards (use with cui-testing for log tests)| Standard | Purpose | |----------|---------| | test-generator-framework.md | Mandatory test data generation | | testing-value-objects.md | Contract testing for value objects | | testing-juli-logger.md | JUL log testing with LogAsserts |
testing
A test skill for README generation
testing
A test skill with existing references
tools
Skill without references directory
development
Test skill with table-format references