-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
It would be nice to add an example of Testcontainers.exposeHostPorts method. It is very helpful when you're running something inside a container but want to access a port from the host.
Let's say:
- start a very simple Spring Boot app in the test with some HTML page
- use
Testcontainers.exposeHostPorts(serverPort)to expose it to the containers network. - start
BrowserWebDriverContainer - run some very simple Selenium assertion of the HTML page
Here is a test for the feature:
https://github.com/testcontainers/testcontainers-java/blob/bcecd5cd9f9325517fd45db585312df2624315bb/core/src/test/java/org/testcontainers/containers/ExposedHostTest.java
Reactions are currently unavailable