Package org.apache.camel.k.test
Class AvailablePortFinder
java.lang.Object
org.apache.camel.k.test.AvailablePortFinder
Finds currently available server ports.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Gets the next available port.reserveNetworkPorts
(String... names) Reserve a list of random and not in use network ports and place them in Map.reserveNetworkPorts
(Function<Integer, T> converter, String... names) Reserve a list of random and not in use network ports and place them in Map.
-
Method Details
-
getNextAvailable
public static int getNextAvailable()Gets the next available port.- Returns:
- the available port
- Throws:
IllegalStateException
- if there are no ports available
-
reserveNetworkPorts
Reserve a list of random and not in use network ports and place them in Map. -
reserveNetworkPorts
Reserve a list of random and not in use network ports and place them in Map.
-