Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## UNRELEASED

### Fixed
- Fixed `HostPortWaitStrategy` throws `NumberFormatException` when port is exposed but not mapped [\#640](https://github.com/testcontainers/testcontainers-java/issues/640))

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

public interface ContainerState {
Expand Down Expand Up @@ -127,6 +128,7 @@ default List<Integer> getBoundPortNumbers() {
.map(PortBinding::parse)
.map(PortBinding::getBinding)
.map(Ports.Binding::getHostPortSpec)
.filter(Objects::nonNull)
.map(Integer::valueOf)
.collect(Collectors.toList());
}
Expand Down
4 changes: 3 additions & 1 deletion core/src/test/resources/v2-compose-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: '2'
services:
redis:
image: redis
image: redis
ports:
- 6379