mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 21:25:38 +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:
@@ -28,13 +28,11 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Application test.
|
||||
*/
|
||||
/** Application test. */
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
void shouldExecuteWithoutException() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
assertDoesNotThrow(() -> App.main(new String[] {}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,19 +26,17 @@ package com.iluwatar.specialcase;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.read.ListAppender;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Special cases unit tests. (including the successful scenario {@link ReceiptDto})
|
||||
*/
|
||||
/** Special cases unit tests. (including the successful scenario {@link ReceiptDto}) */
|
||||
class SpecialCasesTest {
|
||||
private static ApplicationServices applicationServices;
|
||||
private static ReceiptViewModel receipt;
|
||||
@@ -102,8 +100,8 @@ class SpecialCasesTest {
|
||||
receipt.show();
|
||||
|
||||
List<ILoggingEvent> loggingEventList = listAppender.list;
|
||||
assertEquals("Out of stock: tv for user = ignite1771 to buy"
|
||||
, loggingEventList.get(0).getMessage());
|
||||
assertEquals(
|
||||
"Out of stock: tv for user = ignite1771 to buy", loggingEventList.get(0).getMessage());
|
||||
assertEquals(Level.INFO, loggingEventList.get(0).getLevel());
|
||||
}
|
||||
|
||||
@@ -119,8 +117,9 @@ class SpecialCasesTest {
|
||||
receipt.show();
|
||||
|
||||
List<ILoggingEvent> loggingEventList = listAppender.list;
|
||||
assertEquals("Insufficient funds: 1000.0 of user: ignite1771 for buying item: car"
|
||||
, loggingEventList.get(0).getMessage());
|
||||
assertEquals(
|
||||
"Insufficient funds: 1000.0 of user: ignite1771 for buying item: car",
|
||||
loggingEventList.get(0).getMessage());
|
||||
assertEquals(Level.INFO, loggingEventList.get(0).getLevel());
|
||||
}
|
||||
|
||||
@@ -136,8 +135,7 @@ class SpecialCasesTest {
|
||||
receipt.show();
|
||||
|
||||
List<ILoggingEvent> loggingEventList = listAppender.list;
|
||||
assertEquals("Receipt: 800.0 paid"
|
||||
, loggingEventList.get(0).getMessage());
|
||||
assertEquals("Receipt: 800.0 paid", loggingEventList.get(0).getMessage());
|
||||
assertEquals(Level.INFO, loggingEventList.get(0).getLevel());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user