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