-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement]: Alternative waiting strategy for Mockserver container #6951
[Enhancement]: Alternative waiting strategy for Mockserver container #6951
Conversation
…rHttp for Wait.forLogMessage. This change will allow Mockserver to work with HTTP and HTTPS requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you so much for your contribution, @DenilssonMontoya ! This is now merged in |
Thank you so much! Glad I could help! |
@@ -36,7 +36,7 @@ public MockServerContainer(DockerImageName dockerImageName) { | |||
super(dockerImageName); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]"
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