mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-20 20:24:47 +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:
@@ -27,32 +27,31 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Tests that Collection Pipeline methods work as expected.
|
||||
*/
|
||||
public class AppTest {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AppTest.class);
|
||||
@Slf4j
|
||||
class AppTest {
|
||||
|
||||
private final List<Car> cars = CarFactory.createCars();
|
||||
|
||||
@Test
|
||||
public void testGetModelsAfter2000UsingFor() {
|
||||
void testGetModelsAfter2000UsingFor() {
|
||||
var models = ImperativeProgramming.getModelsAfter2000(cars);
|
||||
assertEquals(List.of("Avenger", "Wrangler", "Focus", "Cascada"), models);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetModelsAfter2000UsingPipeline() {
|
||||
void testGetModelsAfter2000UsingPipeline() {
|
||||
var models = FunctionalProgramming.getModelsAfter2000(cars);
|
||||
assertEquals(List.of("Avenger", "Wrangler", "Focus", "Cascada"), models);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetGroupingOfCarsByCategory() {
|
||||
void testGetGroupingOfCarsByCategory() {
|
||||
var modelsExpected = Map.of(
|
||||
Category.CONVERTIBLE, List.of(
|
||||
new Car("Buick", "Cascada", 2016, Category.CONVERTIBLE),
|
||||
@@ -74,7 +73,7 @@ public class AppTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSedanCarsOwnedSortedByDate() {
|
||||
void testGetSedanCarsOwnedSortedByDate() {
|
||||
var john = new Person(cars);
|
||||
var modelsExpected = List.of(
|
||||
new Car("Dodge", "Avenger", 2010, Category.SEDAN),
|
||||
|
||||
Reference in New Issue
Block a user