[Enhancement]: Alternative waiting strategy for Mockserver container#6951
Merged
eddumelendez merged 2 commits intotestcontainers:mainfrom May 2, 2023
Merged
Conversation
…rHttp for Wait.forLogMessage. This change will allow Mockserver to work with HTTP and HTTPS requests.
Member
|
Thank you so much for your contribution, @DenilssonMontoya ! This is now merged in |
Contributor
Author
|
Thank you so much! Glad I could help! |
onmomo
reviewed
Oct 31, 2024
| dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME, DockerImageName.parse("mockserver/mockserver")); | ||
|
|
||
| waitingFor(Wait.forHttp("/mockserver/status").withMethod("PUT").forStatusCode(200)); | ||
| waitingFor(Wait.forLogMessage(".*started on port: " + PORT + ".*", 1)); |
There was a problem hiding this comment.
this actually broke our podman rootless execution waiting for mockserver. We went back to the http status check. I wonder why using the default listening for the first exposed is not good enough?
DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-0 << "{"cause":"using --follow with the journald --log-driver but without the journald --events-backend (file) is not supported","message":"failed to obtain logs for Container '33ea4476017d4c49d84f2be6ec2eb7d0eae37ca064bdbab3c8771951f132ab2b': using --follow with the journald --log-driver but without the journald --events-backend (file) is not supported","response":500}[\n]"
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.
Hi
As discussed in #6647, this PR changes the Waiting Strategy for Mockserver container so it becomes possible for it to work with HTTP and HTTPS requests.
Test cases were implemented to validate successful HTTPS requests to Mockserver, testing both cases when requests are made using TLS and mTLS which is described in Mockserver docs https://www.mock-server.com/mock_server/HTTPS_TLS.html