Skip to content

refactor(test-harness): replace Groovy/Spock integration tests with Java/JUnit 5#1234

Open
nthmost-orkes wants to merge 6 commits into
mainfrom
refactor/groovy-to-java-tests
Open

refactor(test-harness): replace Groovy/Spock integration tests with Java/JUnit 5#1234
nthmost-orkes wants to merge 6 commits into
mainfrom
refactor/groovy-to-java-tests

Conversation

@nthmost-orkes

@nthmost-orkes nthmost-orkes commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

(note: this is a Claude Opus + Sonnet refactor, please scrutinize as such)

Replaces the entire Groovy/Spock test suite in test-harness with plain Java + JUnit 5. All 32 specs are converted; the Groovy compiler plugin and Spock/groovy-all dependencies are removed from the module.

  • New AbstractSpecification.java base class: @SpringBootTest + static Testcontainers Redis + @DynamicPropertySource
  • WorkflowTestUtil.java: poll helpers now return Task directly (not Spock Tuple)
  • 29 integration tests + 2 E2E tests converted 1:1 from Groovy
  • 2 resiliency tests ported as @Disabled (they were already @Ignore in Spock — interaction-based mock verification requires spy support that isn't available for Redis queue impls)
  • revGroovy/revSpock kept in dependencies.gradle — still consumed by core, cassandra-persistence, kafka, redis-concurrency-limit, and others

User impact: No behavioral change for users. Flaky ConditionNotSatisfied failures from Spock's with() blocks will be replaced by explicit assertEquals failures that name the actual vs expected value. Contributors no longer need a Groovy/Spock mental model to read or write integration tests.

Closes #1233

- Delete AbstractSpecification.groovy, AbstractResiliencySpecification.groovy,
  WorkflowTestUtil.groovy and replace with Java equivalents
- Delete all 32 Groovy Spock specs (they will be ported incrementally)
- Add AbstractSpecification.java: JUnit 5 + Spring Boot Test + Testcontainers
- Add WorkflowTestUtil.java: poll/complete/fail helpers now return Task directly
  instead of Spock Tuple — callers no longer need to destructure [0]
- Add SimpleWorkflowTest.java: first ported spec (9 tests)

Remaining 31 specs to be converted in follow-up commits on this branch.
Converts all 32 remaining integration and resiliency specs from Groovy/Spock
to plain Java + JUnit 5 + AssertJ, completing the full Groovy-to-Java migration
started in the previous commit. All 32 test classes compile cleanly; resiliency
specs retain @disabled to match the existing @ignore status of the Spock originals.
test-harness no longer has any Groovy source files; drop the groovy plugin
and the groovy-all/spock-core/spock-spring/testcontainers-spock dependencies.
Also remove test-harness from the root spotless groovy configuration block.
…null value

Four test files had Groovy-syntax string comparisons instead of real map equality
checks (e.g. assertEquals("[key:val]", map.toString()) should be
assertEquals(Map.of("key","val"), map)). Also fixed a Map.of() call with a
null value that throws NPE under Java's immutable Map implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Groovy/Spock test-harness with plain Java + JUnit 5

2 participants