Skip to content

Commit

Permalink
[Java] Allow test to run always if the parameter is an IPv4 address.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Jun 25, 2024
1 parent 501cc07 commit cb113e8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
import org.junit.jupiter.params.provider.ValueSource;

import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -356,9 +359,10 @@ void shouldRejectInvalidationReasonThatIsTooLong()
@ParameterizedTest
@ValueSource(strings = { "127.0.0.1", "[::1]" })
@InterruptAfter(5)
void shouldReturnAllParametersToApi(final String addressStr)
void shouldReturnAllParametersToApi(final String addressStr) throws UnknownHostException
{
assumeTrue(System.getProperty("java.net.preferIPv4Stack") == null);
final InetAddress address = InetAddress.getByName(addressStr);
assumeTrue(address instanceof Inet4Address || System.getProperty("java.net.preferIPv4Stack") == null);

context.imageLivenessTimeoutNs(TimeUnit.SECONDS.toNanos(3));

Expand Down

0 comments on commit cb113e8

Please sign in to comment.