Migrate removed LocalStack Service enum and getEndpointOverride in Testcontainers 2.x migration#1014
Merged
Merged
Conversation
794f80a to
c9e334a
Compare
steve-aom-elliott
approved these changes
Jun 8, 2026
steve-aom-elliott
left a comment
Contributor
There was a problem hiding this comment.
Approved, probably just bump the year up in the copyright is all
…n Testcontainers 2.x Testcontainers 2.x removed the nested `LocalStackContainer.Service` enum and `getEndpointOverride(...)`. The existing `Testcontainers2Migration` only renamed the type, leaving `LocalStackContainer.Service.SQS` and `getEndpointOverride(...)` as unresolved references (Java and Kotlin alike). Add a `Testcontainers2LocalStack` step (run before the type rename) that replaces `Service` constants with their service-name strings and `getEndpointOverride(service)` with `getEndpoint()`.
c9e334a to
d0e59da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Testcontainers2Migrationrenamesorg.testcontainers.containers.localstack.LocalStackContainer→org.testcontainers.localstack.LocalStackContainer, but Testcontainers 2.x removed the nestedServiceenum and thegetEndpointOverride(...)method from the new class. So after the type rename,LocalStackContainer.Service.SQSandgetEndpointOverride(...)become unresolved references, breaking compilation in both Java and Kotlin.What
Adds a
Testcontainers2LocalStackstep toTestcontainers2Migration, run before the type rename (so it matches the old type). Fully declarative, composed from core recipes:ReplaceConstant(one perServiceconstant) — replacesLocalStackContainer.Service.Xwith its LocalStack service-name string (e.g."sqs"), including the non-trivial namesAPI_GATEWAY→apigateway,DYNAMODB_STREAMS→dynamodbstreams,CLOUDWATCHLOGS→logs. This makeswithServices(...)compile against the 2.xwithServices(String...)API.ChangeMethodName+DeleteMethodArgument—getEndpointOverride(service)→getEndpoint().Covered by Java + Kotlin tests, including an end-to-end reproduction through the full
Testcontainers2Migration.Part of moderneinc/customer-requests#2437 (the unresolved-references half; the separate ktlint-comment-removal issue is not addressed here).