Skip to content

Commit

Permalink
Fix sonar cloud code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
NenadJeckovic committed Mar 8, 2024
1 parent b6f8992 commit 537b0f2
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public record DeleteBookApi(DeleteBookUseCase deleteBookUseCase) {

@DeleteMapping("/{bookId}")
public void DeleteBook(@PathVariable("bookId") Long bookId){
public void deleteBook(@PathVariable("bookId") Long bookId){
log.debug("DELETE request recieved with book id: {}", bookId);
deleteBookUseCase.deleteBook(bookId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package com.productdock.adapter.out.kafka;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.productdock.adapter.out.kafka.mapper.AddedBookMessageMapper;
import com.productdock.adapter.out.kafka.publisher.KafkaPublisher;
import com.productdock.application.port.out.messaging.BookCatalogMessagingOutPort;
import com.productdock.application.port.out.messaging.DeleteBookMessagingOutPort;
import com.productdock.domain.Book;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.productdock.application.port.out.messaging;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.productdock.domain.Book;

import java.util.concurrent.ExecutionException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ private String createRentalMessage(BookRentalStateDto bookRentals){
}
String status = bookRentals.status().toString().toLowerCase();
String userName = bookRentals.user().fullName();
String message = "Book is " + status + " by " + userName + ".";
return message;
return "Book is " + status + " by " + userName + ".";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class DeleteBookApiShould {
@Test
void deleteBook(){

deleteBookApi.DeleteBook(DEFAULT_BOOK_ID);
deleteBookApi.deleteBook(DEFAULT_BOOK_ID);

verify(deleteBookUseCase).deleteBook(DEFAULT_BOOK_ID);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static org.mockito.Mockito.verify;

@ExtendWith(MockitoExtension.class)
public class DeleteBookServiceShould {
class DeleteBookServiceShould {

private static final UserProfileDto USER_PROFILE_DTO = new UserProfileDto("Mocked name", null, null);
private static final BookRentalStateDto RENTAL_DTO = new BookRentalStateDto(USER_PROFILE_DTO, null, null);
Expand Down

0 comments on commit 537b0f2

Please sign in to comment.