@@ -10,20 +10,18 @@ import net.corda.testing.driver.internal.incrementalPortAllocation
1010import net.corda.testing.node.NotarySpec
1111import org.assertj.core.api.Assertions.assertThat
1212import org.assertj.core.api.Assertions.assertThatThrownBy
13- import org.junit.Ignore
1413import org.junit.Test
1514import java.net.InetSocketAddress
1615import java.net.ServerSocket
1716
18- @Ignore(" TODO JDK17: Fixme" )
1917class AddressBindingFailureTests {
2018
2119 companion object {
2220 private val portAllocation = incrementalPortAllocation()
2321 }
2422
2523 @Test(timeout= 300_000 )
26- fun `p2p address` () = assertBindExceptionForOverrides { address -> mapOf (" p2pAddress" to address.toString()) }
24+ fun `p2p address` () = assertBindExceptionForOverrides( " localhost " ) { address -> mapOf (" p2pAddress" to address.toString()) }
2725
2826 @Test(timeout= 300_000 )
2927 fun `rpc address` () = assertBindExceptionForOverrides { address -> mapOf (" rpcSettings" to mapOf (" address" to address.toString())) }
@@ -54,11 +52,12 @@ class AddressBindingFailureTests {
5452 }
5553 }
5654
57- private fun assertBindExceptionForOverrides (overrides : (NetworkHostAndPort ) -> Map <String , Any ?>) {
55+ private fun assertBindExceptionForOverrides (bindAddress : String? = null, overrides : (NetworkHostAndPort ) -> Map <String , Any ?>) {
5856
5957 ServerSocket (0 ).use { socket ->
6058
61- val address = InetSocketAddress (" localhost" , socket.localPort).toNetworkHostAndPort()
59+ val address = bindAddress?.let { InetSocketAddress (it, socket.localPort).toNetworkHostAndPort() } ? :
60+ InetSocketAddress (socket.inetAddress, socket.localPort).toNetworkHostAndPort()
6261 driver(DriverParameters (startNodesInProcess = true ,
6362 notarySpecs = emptyList(),
6463 inMemoryDB = false ,
0 commit comments