refactor: Fix some code smells #26

Merged
jank merged 6 commits from refactor/fix-smells into main 2024-10-02 07:48:33 +00:00
Showing only changes of commit 54a76de08c - Show all commits

style: Remove unnecessary blank lines and improve type safety
All checks were successful
Quality Check / Tests (pull_request) Successful in 59s
Quality Check / Checkstyle Main (pull_request) Successful in 46s
gitea-sonarqube-bot OK
Build PR / Build and analyze (pull_request) Successful in 1m55s

Jan K9f 2024-10-02 09:45:08 +02:00
Signed by: jank
GPG key ID: B267751B8AE29EFE

View file

@ -1,7 +1,5 @@
package de.szut.lf8_starter.welcome;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
@ -19,8 +17,8 @@ public class WelcomeController {
}
@GetMapping("/roles")
public ResponseEntity getRoles(Authentication authentication) {
return ResponseEntity.ok(authentication.getAuthorities());
public ResponseEntity<Collection<GrantedAuthority>> getRoles(Authentication authentication) {
return ResponseEntity.ok((Collection<GrantedAuthority>) authentication.getAuthorities());
}