Repository: einToast/MarioKart_Backend
Pull request #119: fix: notification, bump bcprov-jdk15on to bcprov-jdk18on, sortByTeamName
Author: login: einToast
Created: 2025-05-09T08:41:58Z | Merged: 2025-05-09T08:49:24Z

- replace bcprov-jdk15on with bcprov-jdk18on
- fix notifications
- add getTeamsSortedByTeamName


Diff:
diff --git a/pom.xml b/pom.xml
index 3134718..4b2897d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,8 +101,8 @@
         </dependency>
         <dependency>
             <groupId>org.bouncycastle</groupId>
-            <artifactId>bcprov-jdk15on</artifactId>
-            <version>1.70</version>
+            <artifactId>bcprov-jdk18on</artifactId>
+            <version>1.80</version>
         </dependency>
         <dependency>
             <groupId>org.bitbucket.b_c</groupId>
diff --git a/src/main/java/de/fsr/mariokart_backend/notification/controller/admin/AdminNotificationCreateController.java b/src/main/java/de/fsr/mariokart_backend/notification/controller/admin/AdminNotificationCreateController.java
index f6779d6..9ad88b9 100644
--- a/src/main/java/de/fsr/mariokart_backend/notification/controller/admin/AdminNotificationCreateController.java
+++ b/src/main/java/de/fsr/mariokart_backend/notification/controller/admin/AdminNotificationCreateController.java
@@ -10,6 +10,7 @@
 import de.fsr.mariokart_backend.controller.annotation.ApiType;
 import de.fsr.mariokart_backend.controller.annotation.ControllerType;
 import de.fsr.mariokart_backend.exception.NotificationNotSentException;
+import de.fsr.mariokart_backend.notification.model.dto.NotificationRequestDTO;
 import de.fsr.mariokart_backend.notification.service.admin.AdminNotificationCreateService;
 import lombok.AllArgsConstructor;
 
@@ -21,9 +22,9 @@ public class AdminNotificationCreateController {
     private final AdminNotificationCreateService adminNotificationCreateService;
 
     @PostMapping("/send")
-    public ResponseEntity<Void> sendNotificationToAll(@RequestBody String title, @RequestBody String message) {
+    public ResponseEntity<Void> sendNotificationToAll(@RequestBody NotificationRequestDTO notification) {
         try {
-            adminNotificationCreateService.sendNotificationToAll(title, message);
+            adminNotificationCreateService.sendNotificationToAll(notification.getTitle(), notification.getMessage());
             return ResponseEntity.ok().build();
         } catch (NotificationNotSentException e) {
             return ResponseEntity.status(503).build();
@@ -31,10 +32,9 @@ public ResponseEntity<Void> sendNotificationToAll(@RequestBody String title, @Re
     }
 
     @PostMapping("/send/{teamId}")
-    public ResponseEntity<Void> sendNotificationToTeam(@PathVariable Long teamId, @RequestBody String title,
-            @RequestBody String message) {
+    public ResponseEntity<Void> sendNotificationToTeam(@PathVariable Long teamId, @RequestBody NotificationRequestDTO notification) {
         try {
-            adminNotificationCreateService.sendNotificationToTeam(teamId, title, message);
+            adminNotificationCreateService.sendNotificationToTeam(teamId, notification.getTitle(), notification.getMessage());
             return ResponseEntity.ok().build();
         } catch (NotificationNotSentException e) {
             return ResponseEntity.status(503).build();
diff --git a/src/main/java/de/fsr/mariokart_backend/notification/model/dto/NotificationRequestDTO.java b/src/main/java/de/fsr/mariokart_backend/notification/model/dto/NotificationRequestDTO.java
new file mode 100644
index 0000000..cf54f56
--- /dev/null
+++ b/src/main/java/de/fsr/mariokart_backend/notification/model/dto/NotificationRequestDTO.java
@@ -0,0 +1,14 @@
+package de.fsr.mariokart_backend.notification.model.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class NotificationRequestDTO {
+    
+    private String title;
+    private String message;
+}
diff --git a/src/main/java/de/fsr/mariokart_backend/notification/service/admin/AdminNotificationCreateService.java b/src/main/java/de/fsr/mariokart_backend/notification/service/admin/AdminNotificationCreateService.java
index 0e44492..7140afc 100644
--- a/src/main/java/de/fsr/mariokart_backend/notification/service/admin/AdminNotificationCreateService.java
+++ b/src/main/java/de/fsr/mariokart_backend/notification/service/admin/AdminNotificationCreateService.java
@@ -3,8 +3,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -18,24 +16,19 @@
 @Service
 @AllArgsConstructor
 public class AdminNotificationCreateService {
-    private static final Logger logger = LoggerFactory.getLogger(AdminNotificationCreateService.class);
 
     private final PushSubscriptionRepository subscriptionRepository;
     private final ObjectMapper objectMapper;
     private final NotificationSendService notificationSendService;
 
     public void sendNotificationToAll(String title, String message) throws NotificationNotSentException {
-        logger.info("Sende Benachrichtigung an alle: {}", message);
         List<PushSubscription> subscriptions = subscriptionRepository.findAll();
-        logger.info("Gefundene Subscriptions: {}", subscriptions.size());
         try {
             for (PushSubscription subscription : subscriptions) {
-                logger.info("Nachricht für Subscription {} ist kein JSON, erstelle JSON-Objekt", subscription.getId());
                 String payload = objectMapper.writeValueAsString(Map.of(
                         "title", title,
                         "body", message));
 
-                logger.info("Sende Nachricht an Subscription {}: {}", subscription.getId(), payload);
                 notificationSendService.sendNotification(subscription, payload);
             }
         } catch (Exception e) {
@@ -44,21 +37,14 @@ public void sendNotificationToAll(String title, String message) throws Notificat
     }
 
     public void sendNotificationToTeam(Long teamId, String title, String message) throws NotificationNotSentException {
-        logger.info("Sende Benachrichtigung an Team {}: {}", teamId, message);
         List<PushSubscription> subscriptions = subscriptionRepository.findByTeamId(teamId);
-        logger.info("Gefundene Subscriptions für Team {}: {}", teamId, subscriptions.size());
 
         try {
             for (PushSubscription subscription : subscriptions) {
-                logger.info("Nachricht für Team {} an Subscription {} ist kein JSON, erstelle JSON-Objekt", teamId,
-                        subscription.getId());
                 String payload = objectMapper.writeValueAsString(Map.of(
                         "title", title,
                         "body", message));
 
-                logger.info("Sende Nachricht an Subscription {} für Team {}: {}", subscription.getId(), teamId,
-                        payload);
-
                 notificationSendService.sendNotification(subscription, payload);
             }
         } catch (Exception e) {
diff --git a/src/main/java/de/fsr/mariokart_backend/registration/controller/pub/PublicRegistrationReadController.java b/src/main/java/de/fsr/mariokart_backend/registration/controller/pub/PublicRegistrationReadController.java
index 8d9ede0..fa66f7f 100644
--- a/src/main/java/de/fsr/mariokart_backend/registration/controller/pub/PublicRegistrationReadController.java
+++ b/src/main/java/de/fsr/mariokart_backend/registration/controller/pub/PublicRegistrationReadController.java
@@ -31,6 +31,11 @@ public List<TeamReturnDTO> getTeamsSortedByGroupPoints() {
         return publicRegistrationReadService.getTeamsSortedByGroupPoints();
     }
 
+    @GetMapping("/sortedByTeamName")
+    public List<TeamReturnDTO> getTeamsSortedByTeamName() {
+        return publicRegistrationReadService.getTeamsSortedByTeamName();
+    }
+
     @GetMapping("characters/available")
     public List<CharacterReturnDTO> getAvailableCharacters() {
         return publicRegistrationReadService.getAvailableCharacters();
diff --git a/src/main/java/de/fsr/mariokart_backend/registration/repository/TeamRepository.java b/src/main/java/de/fsr/mariokart_backend/registration/repository/TeamRepository.java
index 9e39f2b..270c86e 100644
--- a/src/main/java/de/fsr/mariokart_backend/registration/repository/TeamRepository.java
+++ b/src/main/java/de/fsr/mariokart_backend/registration/repository/TeamRepository.java
@@ -28,4 +28,5 @@ public interface TeamRepository extends JpaRepository<Team, Long> {
 
     Optional<Team> findByTeamName(String teamName);
 
+    List<Team> findAllByOrderByTeamNameAsc();
 }
\ No newline at end of file
diff --git a/src/main/java/de/fsr/mariokart_backend/registration/service/pub/PublicRegistrationReadService.java b/src/main/java/de/fsr/mariokart_backend/registration/service/pub/PublicRegistrationReadService.java
index ae6f8ce..d84fe52 100644
--- a/src/main/java/de/fsr/mariokart_backend/registration/service/pub/PublicRegistrationReadService.java
+++ b/src/main/java/de/fsr/mariokart_backend/registration/service/pub/PublicRegistrationReadService.java
@@ -74,4 +74,11 @@ public List<TeamReturnDTO> deleteUnnecessaryInformationFromTeams(List<TeamReturn
         teams.forEach(team -> team.setFinalPoints(0));
         return teams;
     }
+
+    public List<TeamReturnDTO> getTeamsSortedByTeamName() {
+        List<TeamReturnDTO> teams = teamRepository.findAllByOrderByTeamNameAsc().stream()
+                .map(registrationReturnDTOService::teamToTeamReturnDTO)
+                .toList();
+        return deleteUnnecessaryInformationFromTeams(teams);
+    }
 }
\ No newline at end of file
diff --git a/src/main/java/de/fsr/mariokart_backend/schedule/service/admin/AdminScheduleUpdateService.java b/src/main/java/de/fsr/mariokart_backend/schedule/service/admin/AdminScheduleUpdateService.java
index d60879a..cf5dd52 100644
--- a/src/main/java/de/fsr/mariokart_backend/schedule/service/admin/AdminScheduleUpdateService.java
+++ b/src/main/java/de/fsr/mariokart_backend/schedule/service/admin/AdminScheduleUpdateService.java
@@ -412,12 +412,13 @@ public void sendNotificationForNextRound(Round round) throws NotificationNotSent
                 title.append(game.getSwitchGame())
                         .append("!");
 
-                String message = "Streng dich an!";
+                StringBuilder message = new StringBuilder(title);
+                message.append(" Streng dich an!");
 
                 adminNotificationCreateService.sendNotificationToTeam(
                         team.getId(),
                         title.toString(),
-                        message);
+                        message.toString());
                 teamsPlaying.add(team);
             }
         }
diff --git a/src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java b/src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java
index a107c7e..f17d152 100644
--- a/src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java
+++ b/src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java
@@ -2,6 +2,7 @@
 
 import java.util.Arrays;
 
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpStatus;
@@ -20,7 +21,6 @@
 
 import de.fsr.mariokart_backend.user.repository.UserRepository;
 import lombok.RequiredArgsConstructor;
-import org.springframework.beans.factory.annotation.Value;
 
 @EnableWebSecurity
 @Configuration
@@ -28,7 +28,7 @@
 public class ApplicationSecurity {
     private final JwtTokenFilter jwtTokenFilter;
     private final UserRepository userRepository;
-    
+
     @Value("${app.cors.allowed-origin}")
     private String allowedOrigin;
 
@@ -67,6 +67,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
     @Bean
     UrlBasedCorsConfigurationSource corsConfigurationSource() {
         CorsConfiguration configuration = new CorsConfiguration();
+        System.out.println("Allowed Origin: " + allowedOrigin);
         configuration.setAllowedOrigins(Arrays.asList(allowedOrigin, "http://127.0.0.1:8100"));
         configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
         configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type", "X-Team-ID"));


Reviews:
user: login: gemini-code-assist[bot]
body: Hello @einToast, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

## Summary of Changes
This pull request includes several updates and fixes. It upgrades the Bouncy Castle provider, fixes notification issues, and adds a new endpoint for retrieving teams sorted by team name. The notification fix involves using a DTO for the request body and streamlining the notification sending process by removing redundant logging. The addition of team name sorting includes changes to the controller, repository, and service layers to implement the new functionality.

### Highlights
* **Dependency Upgrade**: The Bouncy Castle provider dependency `bcprov-jdk15on` has been upgraded to `bcprov-jdk18on` version 1.80 in `pom.xml`.
* **Notification Fix**: The notification sending process in `AdminNotificationCreateController.java` and `AdminNotificationCreateService.java` has been updated to use a `NotificationRequestDTO` and remove unnecessary logging, improving code clarity and efficiency.
* **Team Sorting**: A new endpoint `/sortedByTeamName` has been added to `PublicRegistrationReadController.java` to retrieve teams sorted by team name. This functionality is implemented in `PublicRegistrationReadService.java` and utilizes a new repository method `findAllByOrderByTeamNameAsc` in `TeamRepository.java`.
* **Security Configuration**: The `ApplicationSecurity.java` file was modified to print the allowed origin for CORS configuration, aiding in debugging and configuration verification.

### Changelog
<details>
<summary>Click here to see the changelog</summary>

* **pom.xml**
  * Upgraded `bcprov-jdk15on` to `bcprov-jdk18on` version 1.80.
* **src/main/java/de/fsr/mariokart_backend/notification/controller/admin/AdminNotificationCreateController.java**
  * Added import for `NotificationRequestDTO`.
  * Modified `sendNotificationToAll` and `sendNotificationToTeam` methods to accept `NotificationRequestDTO` instead of separate title and message parameters.
  * Updated method calls to `adminNotificationCreateService` to use the title and message from the `NotificationRequestDTO`.
* **src/main/java/de/fsr/mariokart_backend/notification/model/dto/NotificationRequestDTO.java**
  * Created `NotificationRequestDTO` with `title` and `message` fields.
* **src/main/java/de/fsr/mariokart_backend/notification/service/admin/AdminNotificationCreateService.java**
  * Removed unnecessary logging statements.
  * Updated `sendNotificationToAll` and `sendNotificationToTeam` methods to remove redundant logging and improve code readability.
* **src/main/java/de/fsr/mariokart_backend/registration/controller/pub/PublicRegistrationReadController.java**
  * Added new endpoint `/sortedByTeamName` to retrieve teams sorted by team name.
* **src/main/java/de/fsr/mariokart_backend/registration/repository/TeamRepository.java**
  * Added method `findAllByOrderByTeamNameAsc` to retrieve all teams sorted by team name in ascending order.
* **src/main/java/de/fsr/mariokart_backend/registration/service/pub/PublicRegistrationReadService.java**
  * Added method `getTeamsSortedByTeamName` to retrieve and return teams sorted by team name.
* **src/main/java/de/fsr/mariokart_backend/schedule/service/admin/AdminScheduleUpdateService.java**
  * Modified the message creation for notifications to use a StringBuilder for efficiency and include the game title.
* **src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java**
  * Added a print statement to output the allowed origin for CORS configuration.

</details>


<details>

<summary><b>Using Gemini Code Assist</b></summary>
<br>

The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.

<b>Invoking Gemini</b>

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands.

Feature | Command | Description
--- | --- | ---
Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments.
Help | `/gemini help` | Displays a list of available commands.

<b>Customization</b>

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).

<b>Limitations & Feedback</b>

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments to provide feedback.

</details>

<b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b>


[^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/review-github-code). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).

---

> A new sort, a team's name,
> In order, a sorted game.
> Code aligns with grace,
> In its proper place,
> A list refined, not the same.


state: COMMENTED
author_association: NONE
submitted_at: 2025-05-09T08:42:13Z
user: login: gemini-code-assist[bot]
body: ## Code Review
The pull request includes several changes: updating the Bouncy Castle provider, fixing notification logic, and adding a new endpoint to sort teams by name. The changes seem reasonable, but I have a few comments regarding the notification logic and code clarity.

### Summary of Findings
* **Notification Message Construction**: In `AdminScheduleUpdateService.java`, the notification message is constructed by appending to the title. This approach might lead to redundant information in the message. Consider creating a more descriptive message from scratch.
* **Unnecessary Logger Statements**: The removal of logger statements in `AdminNotificationCreateService.java` improves code cleanliness. However, ensure that logging is still sufficient for debugging and monitoring purposes, perhaps in a different manner.
* **Security Configuration CORS**: The addition of `System.out.println` to print the allowed origin in `ApplicationSecurity.java` is not recommended for production code. This should be replaced with proper logging.

### Merge Readiness
The pull request is almost ready for merging. However, the issues identified regarding notification message construction and the CORS configuration should be addressed before merging. I am unable to approve this pull request, and recommend that others review and approve this code before merging.
state: CHANGES_REQUESTED
author_association: NONE
submitted_at: 2025-05-09T08:42:28Z
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR addresses three main concerns: updating the BouncyCastle dependency, fixing notification issues, and adding functionality to sort teams by team name.  
- Replace bcprov-jdk15on with bcprov-jdk18on in pom.xml  
- Update notification endpoints and services to use a DTO for title and message  
- Introduce getTeamsSortedByTeamName in the registration service and new controller endpoint

### Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

<details>
<summary>Show a summary per file</summary>

| File | Description |
| ---- | ----------- |
| src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java | Adds a proper import and includes a debug print for allowedOrigin (consider using a logger). |
| src/main/java/de/fsr/mariokart_backend/schedule/service/admin/AdminScheduleUpdateService.java | Updates message creation with StringBuilder for notifications. |
| src/main/java/de/fsr/mariokart_backend/registration/service/pub/PublicRegistrationReadService.java | Adds getTeamsSortedByTeamName to return teams sorted by team name. |
| src/main/java/de/fsr/mariokart_backend/registration/repository/TeamRepository.java | Introduces findAllByOrderByTeamNameAsc to support sorted team retrieval. |
| src/main/java/de/fsr/mariokart_backend/registration/controller/pub/PublicRegistrationReadController.java | Adds a new endpoint for sorted team names. |
| src/main/java/de/fsr/mariokart_backend/notification/service/admin/AdminNotificationCreateService.java | Removes several logger.info statements to streamline notification sending. |
| src/main/java/de/fsr/mariokart_backend/notification/model/dto/NotificationRequestDTO.java | Creates a new DTO to encapsulate notification title and message. |
| src/main/java/de/fsr/mariokart_backend/notification/controller/admin/AdminNotificationCreateController.java | Refactors notification endpoints to use NotificationRequestDTO for improved request handling. |
| pom.xml | Bumps dependency for BouncyCastle from bcprov-jdk15on to bcprov-jdk18on and updates the version. |
</details>





state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T08:42:33Z

Review comments:
diff_hunk: @@ -67,6 +67,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
     @Bean
     UrlBasedCorsConfigurationSource corsConfigurationSource() {
         CorsConfiguration configuration = new CorsConfiguration();
+        System.out.println("Allowed Origin: " + allowedOrigin);
path: src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java
user: login: gemini-code-assist[bot]
body: ![high](https://img.shields.io/badge/priority-high-orange)

Printing the allowed origin to the console is not recommended for production code. This is better handled with proper logging. Replace `System.out.println` with a logger.

```suggestion
        // Use a logger instead of System.out.println
        // logger.info("Allowed Origin: {}", allowedOrigin);
```
created_at: 2025-05-09T08:42:28Z
author_association: NONE
diff_hunk: @@ -18,24 +16,19 @@
 @Service
 @AllArgsConstructor
 public class AdminNotificationCreateService {
-    private static final Logger logger = LoggerFactory.getLogger(AdminNotificationCreateService.class);
 
     private final PushSubscriptionRepository subscriptionRepository;
     private final ObjectMapper objectMapper;
path: src/main/java/de/fsr/mariokart_backend/notification/service/admin/AdminNotificationCreateService.java
user: login: gemini-code-assist[bot]
body: ![medium](https://img.shields.io/badge/priority-medium-yellow)

The logger was removed, which is fine if it's deemed unnecessary. However, ensure sufficient logging exists elsewhere for debugging and monitoring purposes. Consider using a more structured logging approach if needed.
created_at: 2025-05-09T08:42:28Z
author_association: NONE
diff_hunk: @@ -412,19 +412,20 @@
                 title.append(game.getSwitchGame())
                         .append("!");
 
-                String message = "Streng dich an!";
+                StringBuilder message = new StringBuilder(title);
+                message.append(" Streng dich an!");
path: src/main/java/de/fsr/mariokart_backend/schedule/service/admin/AdminScheduleUpdateService.java
user: login: gemini-code-assist[bot]
body: ![medium](https://img.shields.io/badge/priority-medium-yellow)

Instead of appending to the title, consider creating a more descriptive message from scratch. Appending the title might lead to redundant or awkward phrasing. For example, the title already contains the game, so repeating it in the message might not be ideal.

```suggestion
                StringBuilder message = new StringBuilder("Streng dich an beim Switch " + game.getSwitchGame() + "!");
```
created_at: 2025-05-09T08:42:28Z
author_association: NONE
diff_hunk: @@ -67,6 +67,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
     @Bean
     UrlBasedCorsConfigurationSource corsConfigurationSource() {
         CorsConfiguration configuration = new CorsConfiguration();
+        System.out.println("Allowed Origin: " + allowedOrigin);
path: src/main/java/de/fsr/mariokart_backend/security/ApplicationSecurity.java
user: login: Copilot
body: Consider replacing System.out.println with a proper logging framework (e.g., use a logger) to ensure consistent logging and better production diagnostics.
```suggestion
        logger.info("Allowed Origin: {}", allowedOrigin);
```
created_at: 2025-05-09T08:42:33Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-09T08:42:41Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=einToast_MarioKart_Backend&pullRequest=119) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=einToast_MarioKart_Backend&pullRequest=119&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=einToast_MarioKart_Backend&pullRequest=119&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=einToast_MarioKart_Backend&pullRequest=119&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=einToast_MarioKart_Backend&pullRequest=119&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=einToast_MarioKart_Backend&pullRequest=119&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=einToast_MarioKart_Backend&pullRequest=119)


author_association: NONE
user: login: github-actions[bot]
created_at: 2025-05-09T08:46:18Z
body: # [Qodana](https://qodana.cloud/projects/3P5oV/reports/Z7O7l) Community for JVM

**25 new problems** were found

| Inspection name | Severity | Problems |
| --- | --- | --- |
| `Constant values` | 🔶 Warning | 4 |
| `Default annotation parameter value` | 🔶 Warning | 3 |
| `@NotNull/@Nullable problems` | 🔶 Warning | 3 |
| `Unused assignment` | 🔶 Warning | 3 |
| `Stream API call chain can be simplified` | 🔶 Warning | 2 |
| `Redundant local variable` | 🔶 Warning | 2 |
| `Statement with empty body` | 🔶 Warning | 1 |
| `Integer multiplication or shift implicitly cast to 'long'` | 🔶 Warning | 1 |
| `Lombok @Getter may be used` | 🔶 Warning | 1 |
| `Optional.get() is called without isPresent() check` | 🔶 Warning | 1 |
| `'StringBuilder' can be replaced with 'String'` | 🔶 Warning | 1 |
| `Redundant 'if' statement` | 🔶 Warning | 1 |
| `Commented out code` | ◽️ Notice | 2 |



☁️ [View the detailed Qodana report](https://qodana.cloud/projects/3P5oV/reports/Z7O7l)

<details>
<summary>Contact Qodana team</summary>

Contact us at [qodana-support@jetbrains.com](mailto:qodana-support@jetbrains.com)
  - Or via our issue tracker: https://jb.gg/qodana-issue
  - Or share your feedback: https://jb.gg/qodana-discussions
</details>
<!-- JetBrains/qodana-action@v2025.1.1 : Qodana Community for JVM,  -->
author_association: NONE