Replace test FilterRegistration with the one in testFixtures

See gh-33252
This commit is contained in:
rstoyanchev
2024-07-26 07:15:11 +01:00
parent 24ab6f61de
commit 5ac7e74bf2
4 changed files with 32 additions and 117 deletions

View File

@@ -38,7 +38,7 @@ import org.springframework.lang.Nullable;
* @author Rossen Stoyanchev
* @since 6.2
*/
public class MockFilterRegistration implements FilterRegistration {
public class MockFilterRegistration implements FilterRegistration.Dynamic {
private final String name;
@@ -50,6 +50,8 @@ public class MockFilterRegistration implements FilterRegistration {
private final List<String> urlPatterns = new ArrayList<>();
private boolean asyncSupported;
public MockFilterRegistration(String className) {
this(className, "");
@@ -126,4 +128,13 @@ public class MockFilterRegistration implements FilterRegistration {
return Collections.unmodifiableCollection(this.urlPatterns);
}
@Override
public void setAsyncSupported(boolean asyncSupported) {
this.asyncSupported = asyncSupported;
}
public boolean isAsyncSupported() {
return this.asyncSupported;
}
}