Remove deprecated SocketUtils
Closes gh-28052
This commit is contained in:
@@ -34,6 +34,7 @@ import javax.management.remote.JMXServiceURL;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.core.testfixture.net.TestSocketUtils;
|
||||
import org.springframework.jmx.AbstractMBeanServerTests;
|
||||
import org.springframework.jmx.IJmxTestBean;
|
||||
import org.springframework.jmx.JmxTestBean;
|
||||
@@ -177,7 +178,7 @@ class MBeanClientInterceptorTests extends AbstractMBeanServerTests {
|
||||
assumeTrue(runTests);
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
final int port = org.springframework.util.SocketUtils.findAvailableTcpPort();
|
||||
final int port = TestSocketUtils.findAvailableTcpPort();
|
||||
|
||||
JMXServiceURL url = new JMXServiceURL("service:jmx:jmxmp://localhost:" + port);
|
||||
JMXConnectorServer connector = JMXConnectorServerFactory.newJMXConnectorServer(url, null, getServer());
|
||||
|
||||
@@ -28,6 +28,8 @@ import javax.management.remote.JMXServiceURL;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
|
||||
import org.springframework.core.testfixture.net.TestSocketUtils;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
* @author Chris Beams
|
||||
@@ -36,7 +38,7 @@ import org.junit.jupiter.api.AfterEach;
|
||||
class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTests {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private final int servicePort = org.springframework.util.SocketUtils.findAvailableTcpPort();
|
||||
private final int servicePort = TestSocketUtils.findAvailableTcpPort();
|
||||
|
||||
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + servicePort;
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import javax.management.remote.JMXServiceURL;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.core.testfixture.net.TestSocketUtils;
|
||||
import org.springframework.jmx.AbstractMBeanServerTests;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -47,7 +48,7 @@ class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests {
|
||||
private static final String OBJECT_NAME = "spring:type=connector,name=test";
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + org.springframework.util.SocketUtils.findAvailableTcpPort();
|
||||
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + TestSocketUtils.findAvailableTcpPort();
|
||||
|
||||
|
||||
@Test
|
||||
|
||||
@@ -24,6 +24,7 @@ import javax.management.remote.JMXServiceURL;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.core.testfixture.net.TestSocketUtils;
|
||||
import org.springframework.jmx.AbstractMBeanServerTests;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -39,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
||||
class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTests {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + org.springframework.util.SocketUtils.findAvailableTcpPort();
|
||||
private final String serviceUrl = "service:jmx:jmxmp://localhost:" + TestSocketUtils.findAvailableTcpPort();
|
||||
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user