From 1c393ead47b6bb99f6d03809d61d5e458038732e Mon Sep 17 00:00:00 2001 From: Phan Huy Tran Date: Wed, 2 Oct 2024 10:22:46 +0200 Subject: [PATCH] Satisfy Sonarqube Issues --- .../de/szut/lf8_starter/project/action/GetProjectAction.java | 2 +- .../java/de/szut/lf8_starter/project/dto/UpdateProjectDto.java | 2 -- .../integration/project/UpdateProjectActionTest.java | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/de/szut/lf8_starter/project/action/GetProjectAction.java b/src/main/java/de/szut/lf8_starter/project/action/GetProjectAction.java index b435bdd..9b4c1e5 100644 --- a/src/main/java/de/szut/lf8_starter/project/action/GetProjectAction.java +++ b/src/main/java/de/szut/lf8_starter/project/action/GetProjectAction.java @@ -38,7 +38,7 @@ public class GetProjectAction { Optional project = this.projectService.findById(id); if (project.isEmpty()) { - return new ResponseEntity<>(null, HttpStatus.NOT_FOUND); + return new ResponseEntity<>(HttpStatus.NOT_FOUND); } return new ResponseEntity<>(this.projectMapper.mapToGetDto(project.get()), HttpStatus.OK); diff --git a/src/main/java/de/szut/lf8_starter/project/dto/UpdateProjectDto.java b/src/main/java/de/szut/lf8_starter/project/dto/UpdateProjectDto.java index 0dc7f69..c3a95f1 100644 --- a/src/main/java/de/szut/lf8_starter/project/dto/UpdateProjectDto.java +++ b/src/main/java/de/szut/lf8_starter/project/dto/UpdateProjectDto.java @@ -3,8 +3,6 @@ package de.szut.lf8_starter.project.dto; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; diff --git a/src/test/java/de/szut/lf8_starter/integration/project/UpdateProjectActionTest.java b/src/test/java/de/szut/lf8_starter/integration/project/UpdateProjectActionTest.java index 795d0bb..b50c15d 100644 --- a/src/test/java/de/szut/lf8_starter/integration/project/UpdateProjectActionTest.java +++ b/src/test/java/de/szut/lf8_starter/integration/project/UpdateProjectActionTest.java @@ -16,7 +16,6 @@ import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;