Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"[java]": {
"editor.defaultFormatter": "redhat.java"
"editor.defaultFormatter": "redhat.java",
"editor.inlayHints.enabled": "off"
},
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic",
Expand Down
2 changes: 1 addition & 1 deletion assets/images/structure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package ar.com.nanotaboada.java.samples.spring.boot.controllers;

import static org.springframework.http.HttpHeaders.LOCATION;

import java.net.URI;
import java.util.List;

import org.springframework.http.HttpHeaders;
import jakarta.validation.Valid;

import org.hibernate.validator.constraints.ISBN;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand All @@ -25,6 +29,7 @@
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;

import ar.com.nanotaboada.java.samples.spring.boot.models.BookDTO;
import ar.com.nanotaboada.java.samples.spring.boot.services.BooksService;

Expand Down Expand Up @@ -52,22 +57,18 @@
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content),
@ApiResponse(responseCode = "409", description = "Conflict", content = @Content)
})
public ResponseEntity<String> post(@RequestBody BookDTO bookDTO) {
if (booksService.retrieveByIsbn(bookDTO.getIsbn()) != null) {
return new ResponseEntity<>(HttpStatus.CONFLICT);
} else {
if (booksService.create(bookDTO)) {
URI location = MvcUriComponentsBuilder
.fromMethodName(BooksController.class, "getByIsbn", bookDTO.getIsbn())
.build()
.toUri();
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setLocation(location);
return new ResponseEntity<>(httpHeaders, HttpStatus.CREATED);
} else {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
public ResponseEntity<Void> post(@RequestBody @Valid BookDTO bookDTO) {
boolean created = booksService.create(bookDTO);
if (!created) {
return ResponseEntity.status(HttpStatus.CONFLICT).build();
}
URI location = MvcUriComponentsBuilder
.fromMethodCall(MvcUriComponentsBuilder.on(BooksController.class).getByIsbn(bookDTO.getIsbn()))
.build()
.toUri();
return ResponseEntity.status(HttpStatus.CREATED)
.header(LOCATION, location.toString())
.build();
}

/*
Expand All @@ -77,18 +78,16 @@
*/

@GetMapping("/books/{isbn}")
@Operation(summary = "Retrieves a book by its ID")
@Operation(summary = "Retrieves a book by its ISBN")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BookDTO.class))),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content)
})
public ResponseEntity<BookDTO> getByIsbn(@PathVariable String isbn) {
BookDTO bookDTO = booksService.retrieveByIsbn(isbn);
if (bookDTO != null) {
return new ResponseEntity<>(bookDTO, HttpStatus.OK);
} else {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
return (bookDTO != null)
? ResponseEntity.status(HttpStatus.OK).body(bookDTO)
: ResponseEntity.status(HttpStatus.NOT_FOUND).build();
}

@GetMapping("/books")
Expand All @@ -98,7 +97,7 @@
})
public ResponseEntity<List<BookDTO>> getAll() {
List<BookDTO> books = booksService.retrieveAll();
return new ResponseEntity<>(books, HttpStatus.OK);
return ResponseEntity.status(HttpStatus.OK).body(books);
}

/*
Expand All @@ -108,22 +107,17 @@
*/

@PutMapping("/books")
@Operation(summary = "Updates (entirely) a book by its ID")
@Operation(summary = "Updates (entirely) a book by its ISBN")
@ApiResponses(value = {
@ApiResponse(responseCode = "204", description = "No Content", content = @Content),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content)
})
public ResponseEntity<String> put(@RequestBody BookDTO bookDTO) {
if (booksService.retrieveByIsbn(bookDTO.getIsbn()) != null) {
if (booksService.update(bookDTO)) {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} else {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
} else {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
public ResponseEntity<Void> put(@RequestBody @Valid BookDTO bookDTO) {
boolean updated = booksService.update(bookDTO);

Check warning on line 117 in src/main/java/ar/com/nanotaboada/java/samples/spring/boot/controllers/BooksController.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 7 lines is too similar to src/main/java/ar/com/nanotaboada/java/samples/spring/boot/controllers/BooksController.java:130
return (updated)

Check warning on line 118 in src/main/java/ar/com/nanotaboada/java/samples/spring/boot/controllers/BooksController.java

View check run for this annotation

Codeac.io / Codeac Code Quality

UselessParentheses

Useless parentheses.
? ResponseEntity.status(HttpStatus.NO_CONTENT).build()
: ResponseEntity.status(HttpStatus.NOT_FOUND).build();
}

/*
Expand All @@ -133,21 +127,16 @@
*/

@DeleteMapping("/books/{isbn}")
@Operation(summary = "Deletes a book by its ID")
@Operation(summary = "Deletes a book by its ISBN")
@ApiResponses(value = {
@ApiResponse(responseCode = "204", description = "No Content", content = @Content),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content)
})
public ResponseEntity<String> delete(@PathVariable String isbn) {
if (booksService.retrieveByIsbn(isbn) != null) {
if (booksService.delete(isbn)) {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} else {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
} else {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
public ResponseEntity<Void> delete(@PathVariable @ISBN String isbn) {
boolean deleted = booksService.delete(isbn);

Check warning on line 137 in src/main/java/ar/com/nanotaboada/java/samples/spring/boot/controllers/BooksController.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 7 lines is too similar to src/main/java/ar/com/nanotaboada/java/samples/spring/boot/controllers/BooksController.java:110
return (deleted)

Check warning on line 138 in src/main/java/ar/com/nanotaboada/java/samples/spring/boot/controllers/BooksController.java

View check run for this annotation

Codeac.io / Codeac Code Quality

UselessParentheses

Useless parentheses.
? ResponseEntity.status(HttpStatus.NO_CONTENT).build()
: ResponseEntity.status(HttpStatus.NOT_FOUND).build();
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
package ar.com.nanotaboada.java.samples.spring.boot.services;

import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;

import java.util.List;
import java.util.stream.StreamSupport;

import lombok.RequiredArgsConstructor;

import org.modelmapper.ModelMapper;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import ar.com.nanotaboada.java.samples.spring.boot.models.Book;
import ar.com.nanotaboada.java.samples.spring.boot.models.BookDTO;
import ar.com.nanotaboada.java.samples.spring.boot.repositories.BooksRepository;

@Service
@RequiredArgsConstructor

Check warning on line 19 in src/main/java/ar/com/nanotaboada/java/samples/spring/boot/services/BooksService.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 7 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/services/BooksServiceTests.java:20
public class BooksService {

private final BooksRepository booksRepository;
private final Validator validator;
private final ModelMapper modelMapper;

/*
Expand All @@ -32,14 +30,14 @@

@CachePut(value = "books", key = "#bookDTO.isbn")
public boolean create(BookDTO bookDTO) {
boolean notExists = !booksRepository.existsById(bookDTO.getIsbn());
boolean valid = validator.validate(bookDTO).isEmpty();
if (notExists && valid) {
if (booksRepository.existsById(bookDTO.getIsbn())) {
return false;
} else {
Book book = mapFrom(bookDTO);
booksRepository.save(book);
return true;
}
return false;

}

/*
Expand All @@ -55,7 +53,7 @@
.orElse(null);
}

@Cacheable(value = "books")

Check failure on line 56 in src/main/java/ar/com/nanotaboada/java/samples/spring/boot/services/BooksService.java

View check run for this annotation

Codeac.io / Codeac Code Quality

UnnecessaryAnnotationValueElement

Avoid the use of value in annotations when its the only element
public List<BookDTO> retrieveAll() {
return StreamSupport.stream(booksRepository.findAll().spliterator(), false)
.map(this::mapFrom)
Expand All @@ -70,14 +68,13 @@

@CachePut(value = "books", key = "#bookDTO.isbn")
public boolean update(BookDTO bookDTO) {
boolean exists = booksRepository.existsById(bookDTO.getIsbn());
boolean valid = validator.validate(bookDTO).isEmpty();
if (exists && valid) {
if (booksRepository.existsById(bookDTO.getIsbn())) {
Book book = mapFrom(bookDTO);
booksRepository.save(book);
return true;
} else {
return false;
}
return false;
}

/*
Expand All @@ -91,8 +88,9 @@
if (booksRepository.existsById(isbn)) {
booksRepository.deleteById(isbn);
return true;
} else {
return false;
}
return false;
}

private BookDTO mapFrom(Book book) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package ar.com.nanotaboada.java.samples.spring.boot.test;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import ar.com.nanotaboada.java.samples.spring.boot.models.BookDTO;

Check warning on line 8 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 7 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java:1
public class BookDTOsBuilder {
public final class BookDTOFakes {

public static BookDTO buildOneValid() {
private BookDTOFakes() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}

public static BookDTO createOneValid() {
BookDTO bookDTO = new BookDTO();
bookDTO.setIsbn("978-1484200773");
bookDTO.setTitle("Pro Git");
Expand All @@ -17,18 +21,18 @@
bookDTO.setPublisher("lulu.com; First Edition");
bookDTO.setPublished(LocalDate.of(2014, 11, 18));
bookDTO.setPages(458);
bookDTO.setDescription(
"""
Pro Git (Second Edition) is your fully-updated guide to Git and its \
usage in the modern world. Git has come a long way since it was first developed by \
Linus Torvalds for Linux kernel development. It has taken the open source world by \
storm since its inception in 2005, and this book teaches you how to use it like a \
pro.""");
bookDTO.setWebsite("https://git-scm.com/book/en/v2");
return bookDTO;

Check warning on line 32 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 8 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java:24
}

public static BookDTO buildOneInvalid() {
public static BookDTO createOneInvalid() {
BookDTO bookDTO = new BookDTO();
bookDTO.setIsbn("978-1234567890"); // Invalid (invalid ISBN)
bookDTO.setTitle("Title");
Expand All @@ -42,7 +46,7 @@
return bookDTO;
}

public static List<BookDTO> buildManyValid() {
public static List<BookDTO> createManyValid() {
ArrayList<BookDTO> bookDTOs = new ArrayList<>();
BookDTO bookDTO9781838986698 = new BookDTO();
bookDTO9781838986698.setIsbn("9781838986698");
Expand All @@ -53,26 +57,26 @@
bookDTO9781838986698.setPublisher("Packt Publishing");
bookDTO9781838986698.setPublished(LocalDate.of(2019, 10, 31));
bookDTO9781838986698.setPages(606);
bookDTO9781838986698.setDescription(
"""
Java is a versatile, popular programming language used across a wide range of \
industries. Learning how to write effective Java code can take your career to \
the next level, and The Java Workshop will help you do just that. This book is \
designed to take the pain out of Java coding and teach you everything you need \
to know to be productive in building real-world software. The Workshop starts by \
showing you how to use classes, methods, and the built-in Collections API to \
manipulate data structures effortlessly. You'll dive right into learning about \
object-oriented programming by creating classes and interfaces and making use of \
inheritance and polymorphism. After learning how to handle exceptions, you'll \
study the modules, packages, and libraries that help you organize your code. As \
you progress, you'll discover how to connect to external databases and web \
servers, work with regular expressions, and write unit tests to validate your \
code. You'll also be introduced to functional programming and see how to \
implement it using lambda functions. By the end of this Workshop, you'll be \
well-versed with key Java concepts and have the knowledge and confidence to \
tackle your own ambitious projects with Java.""");
bookDTO9781838986698.setWebsite("https://www.packtpub.com/free-ebook/the-java-workshop/9781838986698");
bookDTOs.add(bookDTO9781838986698);

Check warning on line 79 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 19 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java:60
BookDTO bookDTO9781789613476 = new BookDTO();
bookDTO9781789613476.setIsbn("9781789613476");
bookDTO9781789613476.setTitle("Hands-On Microservices with Spring Boot and Spring Cloud");
Expand All @@ -82,26 +86,26 @@
bookDTO9781789613476.setPublisher("Packt Publishing");
bookDTO9781789613476.setPublished(LocalDate.of(2019, 9, 20));
bookDTO9781789613476.setPages(668);
bookDTO9781789613476.setDescription(
"""
Microservices architecture allows developers to build and maintain applications \
with ease, and enterprises are rapidly adopting it to build software using \
Spring Boot as their default framework. With this book, you'll learn how to \
efficiently build and deploy microservices using Spring Boot. This microservices \
book will take you through tried and tested approaches to building distributed \
systems and implementing microservices architecture in your organization. \
Starting with a set of simple cooperating microservices developed using Spring \
Boot, you'll learn how you can add functionalities such as persistence, make \
your microservices reactive, and describe their APIs using Swagger/OpenAPI. As \
you advance, you'll understand how to add different services from Spring Cloud \
to your microservice system. The book also demonstrates how to deploy your \
microservices using Kubernetes and manage them with Istio for improved security \
and traffic management. Finally, you'll explore centralized log management using \
the EFK stack and monitor microservices using Prometheus and Grafana. By the end \
of this book, you'll be able to build microservices that are scalable and robust \
using Spring Boot and Spring Cloud.""");
bookDTO9781789613476.setWebsite(
"https://www.packtpub.com/free-ebook/hands-on-microservices-with-spring-boot-and-spring-cloud/9781789613476");

Check warning on line 108 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 19 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java:88
bookDTOs.add(bookDTO9781789613476);
BookDTO bookDTO9781838555726 = new BookDTO();
bookDTO9781838555726.setIsbn("9781838555726");
Expand All @@ -112,26 +116,26 @@
bookDTO9781838555726.setPublisher("Packt Publishing");
bookDTO9781838555726.setPublished(LocalDate.of(2019, 10, 11));
bookDTO9781838555726.setPages(434);
bookDTO9781838555726.setDescription(
"""
Using Kotlin without taking advantage of its power and interoperability is like \
owning a sports car and never taking it out of the garage. While documentation \
and introductory resources can help you learn the basics of Kotlin, the fact \
that it's a new language means that there are limited learning resources and \
code bases available in comparison to Java and other established languages. This \
Kotlin book will show you how to leverage software designs and concepts that \
have made Java the most dominant enterprise programming language. You'll \
understand how Kotlin is a modern approach to object-oriented programming (OOP). \
This book will take you through the vast array of features that Kotlin provides \
over other languages. These features include seamless interoperability with \
Java, efficient syntax, built-in functional programming constructs, and support \
for creating your own DSL. Finally, you will gain an understanding of \
implementing practical design patterns and best practices to help you master the \
Kotlin language. By the end of the book, you'll have obtained an advanced \
understanding of Kotlin in order to be able to build production-grade \
applications.""");
bookDTO9781838555726.setWebsite("https://www.packtpub.com/free-ebook/mastering-kotlin/9781838555726");
bookDTOs.add(bookDTO9781838555726);

Check warning on line 138 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 19 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java:118
BookDTO bookDTO9781484242216 = new BookDTO();
bookDTO9781484242216.setIsbn("9781484242216");
bookDTO9781484242216.setTitle("Rethinking Productivity in Software Engineering");
Expand All @@ -139,15 +143,15 @@
bookDTO9781484242216.setPublisher("Apress");
bookDTO9781484242216.setPublished(LocalDate.of(2019, 5, 7));
bookDTO9781484242216.setPages(301);
bookDTO9781484242216.setDescription(
"""
Get the most out of this foundational reference and improve the productivity of \
your software teams. This open access book collects the wisdom of the 2017 \
"Dagstuhl" seminar on productivity in software engineering, a meeting of \
community leaders, who came together with the goal of rethinking traditional \
definitions and measures of productivity.""");
bookDTO9781484242216.setWebsite("https://link.springer.com/book/10.1007/978-1-4842-4221-6");
bookDTOs.add(bookDTO9781484242216);

Check warning on line 154 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 8 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java:145
return bookDTOs;
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package ar.com.nanotaboada.java.samples.spring.boot.test;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import ar.com.nanotaboada.java.samples.spring.boot.models.Book;

Check warning on line 8 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 7 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java:1
public class BooksBuilder {
public final class BookFakes {

public static Book buildOneValid() {
private BookFakes() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}

public static Book createOneValid() {
Book book = new Book();
book.setIsbn("9781484200773");
book.setTitle("Pro Git");
Expand All @@ -17,18 +21,18 @@
book.setPublisher("lulu.com; First Edition");
book.setPublished(LocalDate.of(2014, 11, 18));
book.setPages(458);
book.setDescription(
"""
Pro Git (Second Edition) is your fully-updated guide to Git and its \
usage in the modern world. Git has come a long way since it was first developed by \
Linus Torvalds for Linux kernel development. It has taken the open source world by \
storm since its inception in 2005, and this book teaches you how to use it like a \
pro.""");
book.setWebsite("https://git-scm.com/book/en/v2");
return book;

Check warning on line 32 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 8 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java:24
}

public static Book buildOneInvalid() {
public static Book createOneInvalid() {
Book book = new Book();
book.setIsbn("9781234567890"); // Invalid (invalid ISBN)
book.setTitle("Title");
Expand All @@ -42,37 +46,37 @@
return book;
}

public static List<Book> buildManyValid() {
public static List<Book> createManyValid() {
ArrayList<Book> books = new ArrayList<>();
Book book9781838986698 = new Book();
book9781838986698.setIsbn("9781838986698");
book9781838986698.setTitle("The Java Workshop");
book9781838986698
.setSubtitle("Learn object-oriented programming and kickstart your career in software development");
book9781838986698.setAuthor("David Cuartielles, Andreas Göransson, Eric Foster-Johnson");
book9781838986698.setPublisher("Packt Publishing");
book9781838986698.setPublished(LocalDate.of(2019, 10, 31));
book9781838986698.setPages(606);
book9781838986698.setDescription(
"""
Java is a versatile, popular programming language used across a wide range of \
industries. Learning how to write effective Java code can take your career to \
the next level, and The Java Workshop will help you do just that. This book is \
designed to take the pain out of Java coding and teach you everything you need \
to know to be productive in building real-world software. The Workshop starts by \
showing you how to use classes, methods, and the built-in Collections API to \
manipulate data structures effortlessly. You'll dive right into learning about \
object-oriented programming by creating classes and interfaces and making use of \
inheritance and polymorphism. After learning how to handle exceptions, you'll \
study the modules, packages, and libraries that help you organize your code. As \
you progress, you'll discover how to connect to external databases and web \
servers, work with regular expressions, and write unit tests to validate your \
code. You'll also be introduced to functional programming and see how to \
implement it using lambda functions. By the end of this Workshop, you'll be \
well-versed with key Java concepts and have the knowledge and confidence to \
tackle your own ambitious projects with Java.""");
book9781838986698.setWebsite("https://www.packtpub.com/free-ebook/the-java-workshop/9781838986698");
books.add(book9781838986698);

Check warning on line 79 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 19 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java:60
Book book9781789613476 = new Book();
book9781789613476.setIsbn("9781789613476");
book9781789613476.setTitle("Hands-On Microservices with Spring Boot and Spring Cloud");
Expand All @@ -81,26 +85,26 @@
book9781789613476.setPublisher("Packt Publishing");
book9781789613476.setPublished(LocalDate.of(2019, 9, 20));
book9781789613476.setPages(668);
book9781789613476.setDescription(
"""
Microservices architecture allows developers to build and maintain applications \
with ease, and enterprises are rapidly adopting it to build software using \
Spring Boot as their default framework. With this book, you'll learn how to \
efficiently build and deploy microservices using Spring Boot. This microservices \
book will take you through tried and tested approaches to building distributed \
systems and implementing microservices architecture in your organization. \
Starting with a set of simple cooperating microservices developed using Spring \
Boot, you'll learn how you can add functionalities such as persistence, make \
your microservices reactive, and describe their APIs using Swagger/OpenAPI. As \
you advance, you'll understand how to add different services from Spring Cloud \
to your microservice system. The book also demonstrates how to deploy your \
microservices using Kubernetes and manage them with Istio for improved security \
and traffic management. Finally, you'll explore centralized log management using \
the EFK stack and monitor microservices using Prometheus and Grafana. By the end \
of this book, you'll be able to build microservices that are scalable and robust \
using Spring Boot and Spring Cloud.""");
book9781789613476.setWebsite(
"https://www.packtpub.com/free-ebook/hands-on-microservices-with-spring-boot-and-spring-cloud/9781789613476");

Check warning on line 107 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 19 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java:89
books.add(book9781789613476);
Book book9781838555726 = new Book();
book9781838555726.setIsbn("9781838555726");
Expand All @@ -111,26 +115,26 @@
book9781838555726.setPublisher("Packt Publishing");
book9781838555726.setPublished(LocalDate.of(2019, 10, 11));
book9781838555726.setPages(434);
book9781838555726.setDescription(
"""
Using Kotlin without taking advantage of its power and interoperability is like \
owning a sports car and never taking it out of the garage. While documentation \
and introductory resources can help you learn the basics of Kotlin, the fact \
that it's a new language means that there are limited learning resources and \
code bases available in comparison to Java and other established languages. This \
Kotlin book will show you how to leverage software designs and concepts that \
have made Java the most dominant enterprise programming language. You'll \
understand how Kotlin is a modern approach to object-oriented programming (OOP). \
This book will take you through the vast array of features that Kotlin provides \
over other languages. These features include seamless interoperability with \
Java, efficient syntax, built-in functional programming constructs, and support \
for creating your own DSL. Finally, you will gain an understanding of \
implementing practical design patterns and best practices to help you master the \
Kotlin language. By the end of the book, you'll have obtained an advanced \
understanding of Kotlin in order to be able to build production-grade \
applications.""");
book9781838555726.setWebsite("https://www.packtpub.com/free-ebook/mastering-kotlin/9781838555726");
books.add(book9781838555726);

Check warning on line 137 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 19 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java:119
Book book9781484242216 = new Book();
book9781484242216.setIsbn("9781484242216");
book9781484242216.setTitle("Rethinking Productivity in Software Engineering");
Expand All @@ -138,15 +142,15 @@
book9781484242216.setPublisher("Apress");
book9781484242216.setPublished(LocalDate.of(2019, 5, 7));
book9781484242216.setPages(301);
book9781484242216.setDescription(
"""
Get the most out of this foundational reference and improve the productivity of \
your software teams. This open access book collects the wisdom of the 2017 \
"Dagstuhl" seminar on productivity in software engineering, a meeting of \
community leaders, who came together with the goal of rethinking traditional \
definitions and measures of productivity.""");
book9781484242216.setWebsite("https://link.springer.com/book/10.1007/978-1-4842-4221-6");
books.add(book9781484242216);

Check warning on line 153 in src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookFakes.java

View check run for this annotation

Codeac.io / Codeac Code Quality

CodeDuplication

This block of 8 lines is too similar to src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/BookDTOFakes.java:146
return books;
}
}
Loading
Loading