Merge branch '2.2.x' into 2.3.x

Closes gh-24747
This commit is contained in:
Phillip Webb
2021-01-11 14:21:56 -08:00
4 changed files with 117 additions and 71 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@@ -913,7 +913,7 @@ class WebMvcAutoConfigurationTests {
protected Map<String, List<Resource>> getResourceMappingLocations(ApplicationContext context) {
Object bean = context.getBean("resourceHandlerMapping");
if (bean instanceof HandlerMapping) {
return getMappingLocations(context.getBean("resourceHandlerMapping", HandlerMapping.class));
return getMappingLocations((HandlerMapping) bean);
}
assertThat(bean.toString()).isEqualTo("null");
return Collections.emptyMap();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 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.
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.web.servlet;
import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -162,8 +161,7 @@ class WelcomePageHandlerMappingTests {
return new WelcomePageHandlerMapping(
templateAvailabilityProviders
.getIfAvailable(() -> new TemplateAvailabilityProviders(applicationContext)),
applicationContext, Optional.ofNullable(staticIndexPage.getIfAvailable()), staticPathPattern);
applicationContext, staticIndexPage.getIfAvailable(), staticPathPattern);
}
}