Fix HttpDslTests for latest Spring Security
This commit is contained in:
@@ -70,6 +70,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
|
||||
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig;
|
||||
import org.springframework.test.web.client.MockMvcClientHttpRequestFactory;
|
||||
@@ -321,9 +322,9 @@ public class HttpDslTests {
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
return http.
|
||||
authorizeRequests()
|
||||
.antMatchers("/service/internal/**").hasRole("ADMIN")
|
||||
return http
|
||||
.authorizeHttpRequests()
|
||||
.requestMatchers(new AntPathRequestMatcher("/service/internal/**")).hasRole("ADMIN")
|
||||
.anyRequest().permitAll()
|
||||
.and()
|
||||
.httpBasic()
|
||||
|
||||
Reference in New Issue
Block a user