📍Use lombok, reformat, and optimize the code (#1560)

* Use lombok, reformat, and optimize the code

* Fix merge conflicts and some sonar issues

Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
va1m
2021-03-13 13:19:21 +01:00
committed by GitHub
parent 0e26a6adb5
commit 5cf2fe009b
681 changed files with 2472 additions and 4966 deletions

View File

@@ -38,12 +38,12 @@ import org.junit.jupiter.api.Test;
/**
* Integration test of IQueryService and ICommandService with h2 data
*/
public class IntegrationTest {
class IntegrationTest {
private static IQueryService queryService;
@BeforeAll
public static void initializeAndPopulateDatabase() {
static void initializeAndPopulateDatabase() {
var commandService = new CommandServiceImpl();
queryService = new QueryServiceImpl();
@@ -67,7 +67,7 @@ public class IntegrationTest {
}
@Test
public void testGetAuthorByUsername() {
void testGetAuthorByUsername() {
var author = queryService.getAuthorByUsername("username1");
assertEquals("username1", author.getUsername());
assertEquals("name1", author.getName());
@@ -75,7 +75,7 @@ public class IntegrationTest {
}
@Test
public void testGetUpdatedAuthorByUsername() {
void testGetUpdatedAuthorByUsername() {
var author = queryService.getAuthorByUsername("new_username2");
var expectedAuthor = new Author("new_name2", "new_email2", "new_username2");
assertEquals(expectedAuthor, author);
@@ -83,14 +83,14 @@ public class IntegrationTest {
}
@Test
public void testGetBook() {
void testGetBook() {
var book = queryService.getBook("title1");
assertEquals("title1", book.getTitle());
assertEquals(10, book.getPrice(), 0.01);
}
@Test
public void testGetAuthorBooks() {
void testGetAuthorBooks() {
var books = queryService.getAuthorBooks("username1");
assertEquals(2, books.size());
assertTrue(books.contains(new Book("title1", 10)));
@@ -98,13 +98,13 @@ public class IntegrationTest {
}
@Test
public void testGetAuthorBooksCount() {
void testGetAuthorBooksCount() {
var bookCount = queryService.getAuthorBooksCount("username1");
assertEquals(new BigInteger("2"), bookCount);
}
@Test
public void testGetAuthorsCount() {
void testGetAuthorsCount() {
var authorCount = queryService.getAuthorsCount();
assertEquals(new BigInteger("2"), authorCount);
}