Merge branch '6.2.x'
# Conflicts: # spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceHandlerUtils.java # spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHandlerUtils.java
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-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.
|
||||
@@ -24,6 +24,7 @@ import java.util.function.Function;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.web.servlet.handler.PathPatternsTestUtils;
|
||||
|
||||
@@ -102,4 +103,17 @@ class PathResourceLookupFunctionTests {
|
||||
Collections.emptyList());
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("removal")
|
||||
void withPathResource() {
|
||||
org.springframework.core.io.PathResource location = new org.springframework.core.io.PathResource("/static/");
|
||||
PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location);
|
||||
}
|
||||
|
||||
@Test
|
||||
void withFileSystemResource() {
|
||||
FileSystemResource location = new FileSystemResource("/static/");
|
||||
PathResourceLookupFunction function = new PathResourceLookupFunction("/resources/**", location);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-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.
|
||||
@@ -56,6 +56,7 @@ class ResourceHandlerFunctionTests {
|
||||
|
||||
private ResourceHttpMessageConverter messageConverter;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
void createContext() {
|
||||
this.messageConverter = new ResourceHttpMessageConverter();
|
||||
|
||||
Reference in New Issue
Block a user