ITV / scala-pact

A Scala implementation of CDC using the Pact standard
Other
108 stars 54 forks source link

Be able to configure port on which ScalaMockPactServer listens #232

Closed gaeljw closed 2 years ago

gaeljw commented 2 years ago

ScalaPactMock.startServer() always starts the server on a random port because of the following line:

val scalaPactSettings = ScalaPactSettings(
      ...
      port = Option(0), // `0` means "use any available port".
      ...
    )

(https://github.com/ITV/scala-pact/blob/main/scalapact-scalatest/src/main/scala/com/itv/scalapact/ScalaPactMock.scala#L41)

It would be nice if the port can be chosen via a method parameter.

Do you have any opinion on this? If I provide a PR for this, are you willing to merge it and release it?

jbwheatley commented 2 years ago

sure go for it

gaeljw commented 2 years ago

Cool, opened a PR if you want to have a look @jbwheatley