mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 14:52:24 +00:00
Merge branch '6.0.x'
Closes gh-12626
This commit is contained in:
commit
50bbe88a2e
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -23,6 +23,7 @@ import org.springframework.security.web.context.SecurityContextHolderFilter;
|
|||||||
import org.springframework.security.web.context.SecurityContextPersistenceFilter;
|
import org.springframework.security.web.context.SecurityContextPersistenceFilter;
|
||||||
import org.springframework.security.web.csrf.CsrfFilter;
|
import org.springframework.security.web.csrf.CsrfFilter;
|
||||||
import org.springframework.test.context.aot.TestRuntimeHintsRegistrar;
|
import org.springframework.test.context.aot.TestRuntimeHintsRegistrar;
|
||||||
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link TestRuntimeHintsRegistrar} implementation that register runtime hints for
|
* {@link TestRuntimeHintsRegistrar} implementation that register runtime hints for
|
||||||
@ -35,6 +36,9 @@ class WebTestUtilsTestRuntimeHints implements TestRuntimeHintsRegistrar {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHints(RuntimeHints hints, Class<?> testClass, ClassLoader classLoader) {
|
public void registerHints(RuntimeHints hints, Class<?> testClass, ClassLoader classLoader) {
|
||||||
|
if (!ClassUtils.isPresent("jakarta.servlet.Filter", classLoader)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
registerFilterChainProxyHints(hints);
|
registerFilterChainProxyHints(hints);
|
||||||
registerSecurityContextRepositoryHints(hints);
|
registerSecurityContextRepositoryHints(hints);
|
||||||
registerCsrfTokenRepositoryHints(hints);
|
registerCsrfTokenRepositoryHints(hints);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user