mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-14 18:23:03 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
+1
-3
@@ -48,9 +48,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Program entry point.
|
||||
*/
|
||||
/** Program entry point. */
|
||||
public static void main(String[] args) {
|
||||
|
||||
try (var ignored = new SlidingDoor()) {
|
||||
|
||||
+1
-3
@@ -26,9 +26,7 @@ package com.iluwatar.resource.acquisition.is.initialization;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* SlidingDoor resource.
|
||||
*/
|
||||
/** SlidingDoor resource. */
|
||||
@Slf4j
|
||||
public class SlidingDoor implements AutoCloseable {
|
||||
|
||||
|
||||
+1
-3
@@ -27,9 +27,7 @@ package com.iluwatar.resource.acquisition.is.initialization;
|
||||
import java.io.Closeable;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* TreasureChest resource.
|
||||
*/
|
||||
/** TreasureChest resource. */
|
||||
@Slf4j
|
||||
public class TreasureChest implements Closeable {
|
||||
|
||||
|
||||
+4
-6
@@ -24,17 +24,15 @@
|
||||
*/
|
||||
package com.iluwatar.resource.acquisition.is.initialization;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
|
||||
/**
|
||||
* Application test
|
||||
*/
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Application test */
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
void shouldExecuteWithoutException() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
assertDoesNotThrow(() -> App.main(new String[] {}));
|
||||
}
|
||||
}
|
||||
|
||||
+4
-8
@@ -36,10 +36,7 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* ClosableTest
|
||||
*
|
||||
*/
|
||||
/** ClosableTest */
|
||||
class ClosableTest {
|
||||
|
||||
private InMemoryAppender appender;
|
||||
@@ -56,7 +53,8 @@ class ClosableTest {
|
||||
|
||||
@Test
|
||||
void testOpenClose() {
|
||||
try (final var ignored = new SlidingDoor(); final var ignored1 = new TreasureChest()) {
|
||||
try (final var ignored = new SlidingDoor();
|
||||
final var ignored1 = new TreasureChest()) {
|
||||
assertTrue(appender.logContains("Sliding door opens."));
|
||||
assertTrue(appender.logContains("Treasure chest opens."));
|
||||
}
|
||||
@@ -64,9 +62,7 @@ class ClosableTest {
|
||||
assertTrue(appender.logContains("Sliding door closes."));
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging Appender Implementation
|
||||
*/
|
||||
/** Logging Appender Implementation */
|
||||
static class InMemoryAppender extends AppenderBase<ILoggingEvent> {
|
||||
private final List<ILoggingEvent> log = new LinkedList<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user