Update Test Controllers

Closes gh-9121
This commit is contained in:
Josh Cummings 2020-10-12 16:50:51 -06:00
parent 2dcfda7fac
commit 93c37e6b15
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
2 changed files with 4 additions and 4 deletions

View File

@ -822,19 +822,19 @@ public class MiscHttpConfigTests {
@RestController
static class AuthenticationController {
@GetMapping("/password")
public String password(@AuthenticationPrincipal Authentication authentication) {
public String password(Authentication authentication) {
return (String) authentication.getCredentials();
}
@GetMapping("/roles")
public String roles(@AuthenticationPrincipal Authentication authentication) {
public String roles(Authentication authentication) {
return authentication.getAuthorities().stream()
.map(GrantedAuthority::getAuthority)
.collect(Collectors.joining(","));
}
@GetMapping("/details")
public String details(@AuthenticationPrincipal Authentication authentication) {
public String details(Authentication authentication) {
return authentication.getDetails().getClass().getName();
}
}

View File

@ -176,7 +176,7 @@ class OpaqueTokenDslTests {
@RestController
class AuthenticationController {
@GetMapping("/authenticated")
fun authenticated(@AuthenticationPrincipal authentication: Authentication): String {
fun authenticated(authentication: Authentication): String {
return authentication.name
}
}