Skip to content

Commit 93c37e6

Browse files
committed
Update Test Controllers
Closes gh-9121
1 parent 2dcfda7 commit 93c37e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config/src/test/java/org/springframework/security/config/http/MiscHttpConfigTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -822,19 +822,19 @@ public String customKey() {
822822
@RestController
823823
static class AuthenticationController {
824824
@GetMapping("/password")
825-
public String password(@AuthenticationPrincipal Authentication authentication) {
825+
public String password(Authentication authentication) {
826826
return (String) authentication.getCredentials();
827827
}
828828

829829
@GetMapping("/roles")
830-
public String roles(@AuthenticationPrincipal Authentication authentication) {
830+
public String roles(Authentication authentication) {
831831
return authentication.getAuthorities().stream()
832832
.map(GrantedAuthority::getAuthority)
833833
.collect(Collectors.joining(","));
834834
}
835835

836836
@GetMapping("/details")
837-
public String details(@AuthenticationPrincipal Authentication authentication) {
837+
public String details(Authentication authentication) {
838838
return authentication.getDetails().getClass().getName();
839839
}
840840
}

config/src/test/kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver/OpaqueTokenDslTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class OpaqueTokenDslTests {
176176
@RestController
177177
class AuthenticationController {
178178
@GetMapping("/authenticated")
179-
fun authenticated(@AuthenticationPrincipal authentication: Authentication): String {
179+
fun authenticated(authentication: Authentication): String {
180180
return authentication.name
181181
}
182182
}

0 commit comments

Comments
 (0)