📍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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user