feat(activemq): add execArtemisCommand helper to ArtemisContainer#11859
Open
glasses-and-hat wants to merge 1 commit into
Open
feat(activemq): add execArtemisCommand helper to ArtemisContainer#11859glasses-and-hat wants to merge 1 commit into
glasses-and-hat wants to merge 1 commit into
Conversation
Adds a convenience method that wraps the Artemis CLI binary inside the container, automatically prepending the binary path and appending broker credentials. Users no longer need to hardcode the binary path or pass --user/--password manually when invoking management commands (e.g. creating AMQP queues). Closes testcontainers#11589
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.
Summary
Closes #11589
The
ArtemisContainerbundles the Artemis CLI at/var/lib/artemis-instance/bin/artemis, but using it from tests requires boilerplate: hardcoding the binary path and manually appending--user/--passwordon every call. This PR adds a convenience method that hides those details:Changes:
ArtemisContainer.execArtemisCommand(String... commands)— prepends the CLI binary path and appends--user/--passwordfrom the container's configured credentials, then delegates toexecInContainer.ArtemisContainerTest#execArtemisCommandthat creates an AMQP queue via the CLI and asserts a zero exit code.execArtemisCommand.Test plan
./gradlew :testcontainers-activemq:spotlessApplypasses with no changes./gradlew :testcontainers-activemq:test— requires Docker; verified locally that the container starts and the queue creation command exits 0