Skip to content

Commit 63cd326

Browse files
committed
Update Test Controllers
Closes gh-9121
1 parent 3d9e5d4 commit 63cd326

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -802,18 +802,18 @@ String customKey() {
802802
static class AuthenticationController {
803803

804804
@GetMapping("/password")
805-
String password(@AuthenticationPrincipal Authentication authentication) {
805+
String password(Authentication authentication) {
806806
return (String) authentication.getCredentials();
807807
}
808808

809809
@GetMapping("/roles")
810-
String roles(@AuthenticationPrincipal Authentication authentication) {
810+
String roles(Authentication authentication) {
811811
return authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority)
812812
.collect(Collectors.joining(","));
813813
}
814814

815815
@GetMapping("/details")
816-
String details(@AuthenticationPrincipal Authentication authentication) {
816+
String details(Authentication authentication) {
817817
return authentication.getDetails().getClass().getName();
818818
}
819819

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

+1-1
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)