diff --git a/server/src/main/java/dev/findfirst/core/controller/BookmarkController.java b/server/src/main/java/dev/findfirst/core/controller/BookmarkController.java index 27b6d832..7788b9ee 100644 --- a/server/src/main/java/dev/findfirst/core/controller/BookmarkController.java +++ b/server/src/main/java/dev/findfirst/core/controller/BookmarkController.java @@ -26,6 +26,7 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; +import lombok.RequiredArgsConstructor; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -41,13 +42,12 @@ @RestController @Validated @RequestMapping("/api") +@RequiredArgsConstructor public class BookmarkController { - @Autowired - private BookmarkService bookmarkService; + private final BookmarkService bookmarkService; - @Autowired - private TagService tagService; + private final TagService tagService; @GetMapping("/bookmarks") public ResponseEntity> getAllBookmarks() { diff --git a/server/src/main/java/dev/findfirst/core/controller/TagController.java b/server/src/main/java/dev/findfirst/core/controller/TagController.java index 23a8dcd6..42e72f82 100644 --- a/server/src/main/java/dev/findfirst/core/controller/TagController.java +++ b/server/src/main/java/dev/findfirst/core/controller/TagController.java @@ -2,7 +2,6 @@ import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.lang.NonNull; import org.springframework.web.bind.annotation.DeleteMapping; @@ -15,13 +14,14 @@ import dev.findfirst.core.model.Tag; import dev.findfirst.core.service.TagService; +import lombok.RequiredArgsConstructor; @RestController @RequestMapping("/api") +@RequiredArgsConstructor public class TagController { - @Autowired - TagService tagService; + private final TagService tagService; @GetMapping(value = "/tags") public ResponseEntity> getTags() { diff --git a/server/src/test/java/dev/findfirst/users/service/DefaultEmailServiceTest.java b/server/src/test/java/dev/findfirst/users/service/DefaultEmailServiceTest.java index 52b78de6..46542fe6 100644 --- a/server/src/test/java/dev/findfirst/users/service/DefaultEmailServiceTest.java +++ b/server/src/test/java/dev/findfirst/users/service/DefaultEmailServiceTest.java @@ -24,14 +24,18 @@ @IntegrationTest @TestPropertySource(locations = "classpath:application-test.yml") @WebServiceClientTest(DefaultEmailService.class) -public class DefaultEmailServiceTest { +class DefaultEmailServiceTest { @Value("${spring.mail.port}") int port; @Value("${spring.mail.host}") String host; @Autowired - DefaultEmailService emailService; + DefaultEmailServiceTest(DefaultEmailService emailService) { + this.emailService = emailService; + } + + final DefaultEmailService emailService; @Container public static GenericContainer mailhog =