📍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

@@ -23,22 +23,21 @@
package com.iluwatar.composite;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Date: 12/11/15 - 8:12 PM
*
* @author Jeroen Meulemeester
*/
public class MessengerTest {
class MessengerTest {
/**
* The buffer used to capture every write to {@link System#out}
@@ -54,7 +53,7 @@ public class MessengerTest {
* Inject the mocked std-out {@link PrintStream} into the {@link System} class before each test
*/
@BeforeEach
public void setUp() {
void setUp() {
this.stdOutBuffer = new ByteArrayOutputStream();
System.setOut(new PrintStream(stdOutBuffer));
}
@@ -63,7 +62,7 @@ public class MessengerTest {
* Removed the mocked std-out {@link PrintStream} again from the {@link System} class
*/
@AfterEach
public void tearDown() {
void tearDown() {
System.setOut(realStdOut);
}
@@ -71,7 +70,7 @@ public class MessengerTest {
* Test the message from the orcs
*/
@Test
public void testMessageFromOrcs() {
void testMessageFromOrcs() {
final var messenger = new Messenger();
testMessage(
messenger.messageFromOrcs(),
@@ -83,7 +82,7 @@ public class MessengerTest {
* Test the message from the elves
*/
@Test
public void testMessageFromElves() {
void testMessageFromElves() {
final var messenger = new Messenger();
testMessage(
messenger.messageFromElves(),