Migrate removed LocalStackContainer members to Testcontainers 2.x

MSAL

Testcontainers 2.x removed the nested LocalStackContainer.Service enum and the getEndpointOverride(...) method. Replace LocalStackContainer.Service constants with the equivalent service name strings and getEndpointOverride(service) with getEndpoint(), so code continues to compile against Testcontainers 2.x. This runs while the type is still org.testcontainers.containers.localstack.LocalStackContainer, before it is renamed.

org.openrewrite.java.testing.testcontainers.Testcontainers2LocalStack
mod run . --recipe=org.openrewrite.java.testing.testcontainers.Testcontainers2LocalStack

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Replace constant with literal value
  2. Replace constant with literal value
  3. Replace constant with literal value
  4. Replace constant with literal value
  5. Replace constant with literal value
  6. Replace constant with literal value
  7. Replace constant with literal value
  8. Replace constant with literal value
  9. Replace constant with literal value
  10. Replace constant with literal value
  11. Replace constant with literal value
  12. Replace constant with literal value
  13. Replace constant with literal value
  14. Replace constant with literal value
  15. Replace constant with literal value
  16. Replace constant with literal value
  17. Replace constant with literal value
  18. Replace constant with literal value
  19. Replace constant with literal value
  20. Replace constant with literal value
  21. Replace constant with literal value
  22. Replace constant with literal value
  23. Change method name org.testcontainers.containers.localstack.LocalStackContainer getEndpointOverride(..) to getEndpoint
  24. Delete method argument 0 in methods org.testcontainers.containers.localstack.LocalStackContainer getEndpoint(..)