mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish "Fix Jetty ConnectionLimit configuration"
See gh-39052
This commit is contained in:
parent
7113c10b08
commit
66dc72da46
@ -39,6 +39,7 @@ import org.apache.hc.client5.http.impl.classic.HttpClients;
|
||||
import org.apache.hc.core5.http.Header;
|
||||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.jasper.servlet.JspServlet;
|
||||
import org.assertj.core.api.InstanceOfAssertFactories;
|
||||
import org.awaitility.Awaitility;
|
||||
import org.eclipse.jetty.ee10.servlet.ErrorPageErrorHandler;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletHolder;
|
||||
@ -46,6 +47,7 @@ import org.eclipse.jetty.ee10.webapp.AbstractConfiguration;
|
||||
import org.eclipse.jetty.ee10.webapp.ClassMatcher;
|
||||
import org.eclipse.jetty.ee10.webapp.Configuration;
|
||||
import org.eclipse.jetty.ee10.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.server.AbstractConnector;
|
||||
import org.eclipse.jetty.server.ConnectionLimit;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
@ -72,7 +74,6 @@ import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.InstanceOfAssertFactories.LIST;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.inOrder;
|
||||
@ -551,7 +552,9 @@ class JettyServletWebServerFactoryTests extends AbstractServletWebServerFactoryT
|
||||
Server server = ((JettyWebServer) this.webServer).getServer();
|
||||
assertThat(server.getConnectors()).isEmpty();
|
||||
ConnectionLimit connectionLimit = server.getBean(ConnectionLimit.class);
|
||||
assertThat(connectionLimit).extracting("_connectors", LIST).hasSize(1);
|
||||
assertThat(connectionLimit).extracting("_connectors")
|
||||
.asInstanceOf(InstanceOfAssertFactories.list(AbstractConnector.class))
|
||||
.hasSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user