testcontainers/testcontainers-java

Add getMappedPort(Integer originalPort, InternetProtocol protocol)

Open

#554 opened on Jan 23, 2018

 (12 comments) (0 reactions) (0 assignees)Java (1,588 forks)batch import
good first issueresolution/acknowledgedtype/feature

Repository metrics

Stars
 (7,535 stars)
PR merge metrics
 (PR metrics pending)

Description

It will just look so much nicer in my test than

genericContainer.getContainerInfo().getNetworkSettings().getPorts().getBindings().get(new ExposedPort(originalPort, protocol))[0].getHostPortSpec()

I think it has something to do with the law of demeter.

But in all fairness root cause is https://github.com/moby/moby/issues/4635

Contributor guide