|
|
|
@ -35,6 +35,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; |
|
|
|
import org.springframework.web.context.WebApplicationContext; |
|
|
|
import org.springframework.web.context.WebApplicationContext; |
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static org.springframework.security.config.Customizer.withDefaults; |
|
|
|
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.securityContext; |
|
|
|
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.securityContext; |
|
|
|
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.unauthenticated; |
|
|
|
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.unauthenticated; |
|
|
|
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; |
|
|
|
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; |
|
|
|
@ -98,12 +99,11 @@ public class Gh3409Tests { |
|
|
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception { |
|
|
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception { |
|
|
|
// @formatter:off
|
|
|
|
// @formatter:off
|
|
|
|
http |
|
|
|
http |
|
|
|
.authorizeRequests() |
|
|
|
.authorizeRequests((requests) -> requests |
|
|
|
.requestMatchers("/public/**").permitAll() |
|
|
|
.requestMatchers("/public/**").permitAll() |
|
|
|
.anyRequest().authenticated() |
|
|
|
.anyRequest().authenticated()) |
|
|
|
.and() |
|
|
|
.formLogin(withDefaults()) |
|
|
|
.formLogin().and() |
|
|
|
.httpBasic(withDefaults()); |
|
|
|
.httpBasic(); |
|
|
|
|
|
|
|
return http.build(); |
|
|
|
return http.build(); |
|
|
|
// @formatter:on
|
|
|
|
// @formatter:on
|
|
|
|
} |
|
|
|
} |
|
|
|
|