Integration test each servlet web server with Spring MVC

This commit is contained in:
Andy Wilkinson
2025-05-08 11:50:47 +01:00
committed by Phillip Webb
parent 5b4791fdc6
commit 37b2cdd5bd
8 changed files with 166 additions and 71 deletions

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.tomcat.servlet;
import org.springframework.boot.tomcat.TomcatWebServer;
import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext;
import org.springframework.boot.web.servlet.context.AbstractServletWebServerMvcIntegrationTests;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Integration tests for {@link ServletWebServerApplicationContext} and
* {@link TomcatWebServer} running Spring MVC.
*/
class TomcatServletWebServerMvcIntegrationTests extends AbstractServletWebServerMvcIntegrationTests {
protected TomcatServletWebServerMvcIntegrationTests() {
super(TomcatConfig.class);
}
@Configuration(proxyBeanMethods = false)
static class TomcatConfig {
@Bean
TomcatServletWebServerFactory webServerFactory() {
return new TomcatServletWebServerFactory(0);
}
}
}