1

I am working on integration test written in Spring boot 5 and I am trying to stub downstream services. I have several clients and 3 integration test classes. In my resources folder I have .yml file with following configs:

downstream:
    service
        getSomeData:
            url: http://localhost:666
        getAuthToken:
            url: http://localhost:666
        someOtherClientMethod:
            url: http://localhost:666

And I am using Junit 5 with @WiremockTest annotation.

@WireMockTest(httpPort=666)
class TestSomething {

On my local machine clean build and test commands are working fine, but have fails in Jenkins with error:

com.github.tomakehurst.wiremock.common.FatalStartupException at WireMockServer.java.149 Caused by: java.lang.RunTimeException at JettyServer.java:198 Caused by: java.net.SocketException at Net.java:-2

As I understand the problem is that I have fixed port and I have to use dynamic port. Any suggestions how can I implement that?

1 Answer 1

1

Lower port ranges are sometimes not allowed. Can you try higher port ranges ?

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Nov 16, 2021 at 4:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.