Skip to content

Excavator: Migrate Groovy nebula test CreateManifestTaskIntegrationSpec to the new Java Junit framework#1943

Open
svc-excavator-bot wants to merge 1 commit intodevelopfrom
roomba/migrate-gradle-testing-junit-framework-c849d26c6e3a5e2
Open

Excavator: Migrate Groovy nebula test CreateManifestTaskIntegrationSpec to the new Java Junit framework#1943
svc-excavator-bot wants to merge 1 commit intodevelopfrom
roomba/migrate-gradle-testing-junit-framework-c849d26c6e3a5e2

Conversation

@svc-excavator-bot
Copy link
Copy Markdown
Collaborator

@svc-excavator-bot svc-excavator-bot commented Jan 1, 2026

excavator is a bot for automating changes across repositories.

Changes produced by the roomba/migrate-gradle-testing-junit-framework check.

A formatted diff between the old and new test has been generated at test-migration-notes/CreateManifestTaskIntegrationSpec.html)
To view the rendered diff, copy the branch name above, click here, and then replace the BRANCH_NAME part of the URL with the branch name.

🤖 🤖 This PR was created using Claude-code 🤖 🤖

Model: opus


Claude Execution Message

Claude finished running successfully.

The migration is complete. Here's a summary of what was done:

Migrated: CreateManifestTaskIntegrationSpec.groovy -> CreateManifestTaskIntegrationTest.java

All 9 test methods migrated:

  1. fails_if_lockfile_is_not_up_to_date
  2. fails_if_unexpected_lockfile_exists
  3. fails_if_lock_file_disappears
  4. fails_if_lockfile_has_changed_contents
  5. always_write_project_version_as_minimum_version_in_product_dependency_that_is_published_by_this_repo
  6. writes_locks_when_write_locks_task_is_on_the_command_line (parameterized with @MethodSource)
  7. write_artifacts_to_manifest
  8. fails_if_invalid
  9. write_artifacts_to_manifest_from_task_output
  10. check_depends_on_create_manifest

Plus the readArtifactsExtension helper method and @BeforeEach setup.

Key migration decisions:

  • Spock where: data tables with GradleTestVersions.GRADLE_VERSIONS removed (framework handles multi-version automatically)
  • The writes_locks test's cross-product of gradle versions + task names simplified to only parameterize by task name via @MethodSource
  • PDEP constant kept as a class-level private static final String
  • Subprojects created via rootProject.subproject() since names contain hyphens (can't be Java parameter names)
  • .as() descriptions added to all assertions for better failure messages
  • Delineator comments added to both Groovy (original) and Java (migrated) files

Claude Code Metrics

Metric Value
Total cost $4.22979125
Total Duration (API) 951708 ms
Total Duration (WALL) 1029818 ms
Token usage 4553 (input), 57209 (output)
Cached tokens 119317 (creation), 3648864 (read)

Migration Notes

Test Migration Errors: CreateManifestTaskIntegrationSpec

Compilation Errors

1. Unreported exception JsonProcessingException in readArtifactsExtension

Error: unreported exception JsonProcessingException; must be caught or declared to be thrown
Cause: The ObjectMappers.jsonMapper.readValue() call throws a checked JsonProcessingException (subclass of IOException). The private helper method readArtifactsExtension needed to handle this.
Fix: Wrapped the readValue call in a try-catch block catching IOException and rethrowing as UncheckedIOException.

2. Error Prone: PreferUncheckedIoException

Error: [PreferUncheckedIoException] Prefer UncheckedIOException or SafeUncheckedIoException when wrapping IOException
Cause: Initially wrapped the IOException in RuntimeException instead of UncheckedIOException.
Fix: Changed throw new RuntimeException(e) to throw new UncheckedIOException(e) and added the proper import.

3. Error Prone: StringConcatToTextBlock

Error: [StringConcatToTextBlock] This string literal can be written more clearly as a text block
Cause: The lock file content for barServer.file("product-dependencies.lock") was written as a string concatenation instead of a text block.
Fix: Converted the string concatenation to a Java text block.

Second Pass Review Changes

4. Added .as() descriptions to assertions

Change: Added .as("description") calls to all assertions in "then" blocks that were missing them.
Reason: The testing guide and migration instructions specify that .as() should be used instead of code comments so that descriptions appear in assertion failure messages. Added descriptions to:

  • fails_if_lockfile_is_not_up_to_date: .as("error message about out of date lock file")
  • fails_if_invalid: .as("error message about invalid uri")
  • writes_locks_when_write_locks_task_is_on_the_command_line: .as("createManifest was executed") on task assertion
  • write_artifacts_to_manifest: .as("createManifest was executed") on task assertion
  • check_depends_on_create_manifest: .as("check depends on createManifest")

5. Cleaned up UncheckedIOException import

Change: Added import java.io.UncheckedIOException and replaced the fully-qualified java.io.UncheckedIOException reference.
Reason: Better code style to use the import rather than fully-qualified class name.

No Additional Changes on Third Pass

The third review pass found no further issues. All best practices from the testing guide are followed.

To enable or disable this check, please contact the maintainers of Excavator.

@svc-excavator-bot svc-excavator-bot force-pushed the roomba/migrate-gradle-testing-junit-framework-c849d26c6e3a5e2 branch from e563263 to cbfa2ae Compare February 1, 2026 05:54
@svc-excavator-bot svc-excavator-bot force-pushed the roomba/migrate-gradle-testing-junit-framework-c849d26c6e3a5e2 branch from cbfa2ae to 9182cdf Compare March 1, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant