+ @LocalServerPort
+ int port;
+ String baseUri;
+
+
+ @BeforeEach()
+ void generateBaseUri()
+ {
+ try (final DatagramSocket socket = new DatagramSocket())
+ {
+ socket.connect(InetAddress.getByName("8.8.8.8"), 10002);
+ baseUri =
+ "http://" +
+ socket.getLocalAddress().getHostAddress() +
+ ":" +
+ port;
+ }
+ catch (SocketException | UnknownHostException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+