Skip to content

Commit 5dff157

Browse files
committed
Polish HttpSecurity Formatting
Issue gh-11360
1 parent 400cd60 commit 5dff157

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

config/src/test/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurerTests.java

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -945,13 +945,11 @@ static class FullyAuthenticatedConfig {
945945
SecurityFilterChain chain(HttpSecurity http) throws Exception {
946946
// @formatter:off
947947
http
948-
.httpBasic()
949-
.and()
950-
.rememberMe()
951-
.and()
952-
.authorizeHttpRequests((requests) -> requests
953-
.anyRequest().fullyAuthenticated()
954-
);
948+
.httpBasic(withDefaults())
949+
.rememberMe(withDefaults())
950+
.authorizeHttpRequests((requests) -> requests
951+
.anyRequest().fullyAuthenticated()
952+
);
955953
// @formatter:on
956954
return http.build();
957955
}
@@ -970,13 +968,11 @@ static class RememberMeConfig {
970968
SecurityFilterChain chain(HttpSecurity http) throws Exception {
971969
// @formatter:off
972970
http
973-
.httpBasic()
974-
.and()
975-
.rememberMe()
976-
.and()
977-
.authorizeHttpRequests((requests) -> requests
978-
.anyRequest().rememberMe()
979-
);
971+
.httpBasic(withDefaults())
972+
.rememberMe(withDefaults())
973+
.authorizeHttpRequests((requests) -> requests
974+
.anyRequest().rememberMe()
975+
);
980976
// @formatter:on
981977
return http.build();
982978
}
@@ -995,11 +991,10 @@ static class AnonymousConfig {
995991
SecurityFilterChain chain(HttpSecurity http) throws Exception {
996992
// @formatter:off
997993
http
998-
.httpBasic()
999-
.and()
1000-
.authorizeHttpRequests((requests) -> requests
1001-
.anyRequest().anonymous()
1002-
);
994+
.httpBasic(withDefaults())
995+
.authorizeHttpRequests((requests) -> requests
996+
.anyRequest().anonymous()
997+
);
1003998
// @formatter:on
1004999
return http.build();
10051000
}

0 commit comments

Comments
 (0)