This commit is contained in:
Stéphane Nicoll
2024-01-17 17:43:47 +01:00
parent 699da7c383
commit f5b0d9509d
45 changed files with 373 additions and 411 deletions

View File

@@ -74,7 +74,7 @@ class XmlWebApplicationContextTests extends AbstractApplicationContextTests {
@Test
@SuppressWarnings("deprecation")
public void environmentMerge() {
void environmentMerge() {
assertThat(this.root.getEnvironment().acceptsProfiles("rootProfile1")).isTrue();
assertThat(this.root.getEnvironment().acceptsProfiles("wacProfile1")).isFalse();
assertThat(this.applicationContext.getEnvironment().acceptsProfiles("rootProfile1")).isTrue();
@@ -82,8 +82,7 @@ class XmlWebApplicationContextTests extends AbstractApplicationContextTests {
}
/**
* Overridden as we can't trust superclass method
* @see org.springframework.context.testfixture.AbstractApplicationContextTests#testEvents()
* Overridden as we can't trust superclass method.
*/
@Override
protected void doTestEvents(TestApplicationListener listener, TestApplicationListener parentListener,
@@ -95,12 +94,12 @@ class XmlWebApplicationContextTests extends AbstractApplicationContextTests {
@Test
@Override
public void count() {
protected void count() {
assertThat(this.applicationContext.getBeanDefinitionCount()).as("should have 14 beans").isEqualTo(14);
}
@Test
public void withoutMessageSource() {
void withoutMessageSource() {
MockServletContext sc = new MockServletContext("");
XmlWebApplicationContext wac = new XmlWebApplicationContext();
wac.setParent(root);

View File

@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
class ServletContextSupportTests {
@Test
public void testServletContextAttributeFactoryBean() {
void testServletContextAttributeFactoryBean() {
MockServletContext sc = new MockServletContext();
sc.setAttribute("myAttr", "myValue");
@@ -60,7 +60,7 @@ class ServletContextSupportTests {
}
@Test
public void testServletContextAttributeFactoryBeanWithAttributeNotFound() {
void testServletContextAttributeFactoryBeanWithAttributeNotFound() {
MockServletContext sc = new MockServletContext();
StaticWebApplicationContext wac = new StaticWebApplicationContext();
@@ -76,7 +76,7 @@ class ServletContextSupportTests {
}
@Test
public void testServletContextParameterFactoryBean() {
void testServletContextParameterFactoryBean() {
MockServletContext sc = new MockServletContext();
sc.addInitParameter("myParam", "myValue");
@@ -92,7 +92,7 @@ class ServletContextSupportTests {
}
@Test
public void testServletContextParameterFactoryBeanWithAttributeNotFound() {
void testServletContextParameterFactoryBeanWithAttributeNotFound() {
MockServletContext sc = new MockServletContext();
StaticWebApplicationContext wac = new StaticWebApplicationContext();

View File

@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
class WebApplicationObjectSupportTests {
@Test
public void testWebApplicationObjectSupport() {
void testWebApplicationObjectSupport() {
StaticWebApplicationContext wac = new StaticWebApplicationContext();
wac.setServletContext(new MockServletContext());
File tempDir = new File("");
@@ -49,7 +49,7 @@ class WebApplicationObjectSupportTests {
}
@Test
public void testWebApplicationObjectSupportWithWrongContext() {
void testWebApplicationObjectSupportWithWrongContext() {
StaticApplicationContext ac = new StaticApplicationContext();
ac.registerBeanDefinition("test", new RootBeanDefinition(TestWebApplicationObject.class));
WebApplicationObjectSupport wao = (WebApplicationObjectSupport) ac.getBean("test");
@@ -58,7 +58,7 @@ class WebApplicationObjectSupportTests {
}
public static class TestWebApplicationObject extends WebApplicationObjectSupport {
static class TestWebApplicationObject extends WebApplicationObjectSupport {
}
}

View File

@@ -272,7 +272,7 @@ public class MvcNamespaceTests {
}
@Test // gh-25290
public void testDefaultConfigWithBeansInParentContext() {
void testDefaultConfigWithBeansInParentContext() {
StaticApplicationContext parent = new StaticApplicationContext();
parent.registerSingleton("localeResolver", CookieLocaleResolver.class);
parent.registerSingleton("themeResolver", CookieThemeResolver.class);
@@ -376,7 +376,7 @@ public class MvcNamespaceTests {
@Test
@SuppressWarnings("deprecation")
public void testResources() throws Exception {
void testResources() throws Exception {
loadBeanDefinitions("mvc-config-resources.xml");
HttpRequestHandlerAdapter adapter = appContext.getBean(HttpRequestHandlerAdapter.class);
@@ -439,7 +439,7 @@ public class MvcNamespaceTests {
}
@Test
public void testResourcesWithResolversTransformers() {
void testResourcesWithResolversTransformers() {
loadBeanDefinitions("mvc-config-resources-chain.xml");
SimpleUrlHandlerMapping mapping = appContext.getBean(SimpleUrlHandlerMapping.class);
@@ -484,7 +484,7 @@ public class MvcNamespaceTests {
}
@Test
public void testResourcesWithResolversTransformersCustom() {
void testResourcesWithResolversTransformersCustom() {
loadBeanDefinitions("mvc-config-resources-chain-no-auto.xml");
SimpleUrlHandlerMapping mapping = appContext.getBean(SimpleUrlHandlerMapping.class);

View File

@@ -46,7 +46,7 @@ import static org.springframework.web.servlet.HandlerMapping.PATH_WITHIN_HANDLER
class SimpleUrlHandlerMappingTests {
@Test
public void handlerBeanNotFound() {
void handlerBeanNotFound() {
MockServletContext sc = new MockServletContext("");
XmlWebApplicationContext root = new XmlWebApplicationContext();
root.setServletContext(sc);

View File

@@ -50,7 +50,7 @@ class XlsViewTests {
@Test
public void testXls() throws Exception {
void testXls() throws Exception {
View excelView = new AbstractXlsView() {
@Override
protected void buildExcelDocument(Map<String, Object> model, Workbook workbook,
@@ -73,7 +73,7 @@ class XlsViewTests {
}
@Test
public void testXlsxView() throws Exception {
void testXlsxView() throws Exception {
View excelView = new AbstractXlsxView() {
@Override
protected void buildExcelDocument(Map<String, Object> model, Workbook workbook,
@@ -96,7 +96,7 @@ class XlsViewTests {
}
@Test
public void testXlsxStreamingView() throws Exception {
void testXlsxStreamingView() throws Exception {
View excelView = new AbstractXlsxStreamingView() {
@Override
protected void buildExcelDocument(Map<String, Object> model, Workbook workbook,

View File

@@ -96,7 +96,7 @@ class GroovyMarkupConfigurerTests {
}
@Test
public void parentLoader() throws Exception {
void parentLoader() throws Exception {
this.configurer.setApplicationContext(this.applicationContext);