Prompt file imported from vepo/stomp4j (
.cursor/commands/fix_tests.md). Fill in{{mavenRoot}}before use. Copyright stays with the author.
You are an expert Java developer. Your task is to fix all failing tests in this Maven project.
Prerequisites: Docker must be running (Testcontainers / ActiveMQ).
Follow stomp4j-testing.mdc and stomp4j-test-failure-diagnosis.mdc.
Follow this exact loop — do not ask for confirmation and do not invent workarounds.
-
Discover failures (scoped first)
mvn -Pfast -pl commons,client,server testIf integration tests may be affected, run the relevant module without
-Pfast:mvn -pl client test mvn -pl server testOnly run full
mvn verifyafter module tests are green or when failures span multiple modules. -
Check for failures
- If no test failures in affected modules, run
mvn verifyonce. If green, print✅ All tests pass!and stop. - Otherwise proceed to step 3.
- If no test failures in affected modules, run
-
List each failing test with the reason Parse
*/target/surefire-reports/*.txtor console output. Group failures by root cause (same port, same broker setup, same race → one fix). For each failure:- Test class & method name
- Module (
commons,client,server, …) - Exception type and stack trace
- Assertion details (expected vs actual)
-
Fix each root cause (one at a time)
- Read
ARCHITECTURE.mdfor module boundaries and test strategy. - Read the test code and production code it calls.
- Determine root cause: production bug, incorrect assertion, broker/container setup, etc.
- Apply a direct fix — never
Thread.sleep(),@Disabled, or swallowed exceptions. - Re-run single test:
mvn -pl client test -Dtest=StompClientTcpTest#methodName - Then re-run the module:
mvn -pl client test
- Read
-
Repeat steps 3–4 until affected module tests pass, then run
mvn verifyonce.
After fix is green: write one report under {{mavenRoot}}/reports/ using the template in stomp4j-test-failure-diagnosis.mdc §6 ({sequential}-test-failure-… filename).
Start the loop now.
