Skip to content

Commit

Permalink
Autowired sonar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sandor committed Sep 15, 2024
1 parent 8902011 commit 0c0bbeb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<List<Bookmark>> getAllBookmarks() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<List<Tag>> getTags() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 0c0bbeb

Please sign in to comment.