mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 13:26:33 +00:00
📍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:
@@ -41,24 +41,24 @@ import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* Test for Delegation Pattern
|
||||
*/
|
||||
public class DelegateTest {
|
||||
class DelegateTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
appender = new InMemoryAppender();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
void tearDown() {
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
private static final String MESSAGE = "Test Message Printed";
|
||||
|
||||
@Test
|
||||
public void testCanonPrinter() throws Exception {
|
||||
void testCanonPrinter() throws Exception {
|
||||
var printerController = new PrinterController(new CanonPrinter());
|
||||
printerController.print(MESSAGE);
|
||||
|
||||
@@ -66,7 +66,7 @@ public class DelegateTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHpPrinter() throws Exception {
|
||||
void testHpPrinter() throws Exception {
|
||||
var printerController = new PrinterController(new HpPrinter());
|
||||
printerController.print(MESSAGE);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class DelegateTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEpsonPrinter() throws Exception {
|
||||
void testEpsonPrinter() throws Exception {
|
||||
var printerController = new PrinterController(new EpsonPrinter());
|
||||
printerController.print(MESSAGE);
|
||||
|
||||
@@ -84,7 +84,7 @@ public class DelegateTest {
|
||||
/**
|
||||
* Logging Appender
|
||||
*/
|
||||
private class InMemoryAppender extends AppenderBase<ILoggingEvent> {
|
||||
private static class InMemoryAppender extends AppenderBase<ILoggingEvent> {
|
||||
|
||||
private final List<ILoggingEvent> log = new LinkedList<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user