Skip to content
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

Ability to specify server port(s) for ServiceTest.startServer #3168

Open
solarmosaic-kflorence opened this issue Feb 9, 2021 · 0 comments · May be fixed by #3169
Open

Ability to specify server port(s) for ServiceTest.startServer #3168

solarmosaic-kflorence opened this issue Feb 9, 2021 · 0 comments · May be fixed by #3169

Comments

@solarmosaic-kflorence
Copy link

Lagom Version

Current (1.6.4)

API (Scala / Java / Neither / Both)

Scala (TestKit)

Expected Behavior

I am integrating Lagom integration tests with Optic which requires that the Lagom service start on a specific port (which Optic provides). Therefore I need to be able to specify the port on which a Lagom application will start up when TestServer.startServer is invoked.

Actual Behavior

The port is hard-coded in ServerConfig to Some(0), which means the service will always start on a dynamically assigned port.

https://github.com/lagom/lagom/blob/master/testkit/scaladsl/src/main/scala/com/lightbend/lagom/scaladsl/testkit/ServiceTest.scala#L330

I propose that instead we allow the user to specify a port as part of the Setup configuration. Ideally, the user should have control of all ports (http, https, and any dependent services which are started, such as Cassandra/JDBC).

See also #1584

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant