From d8e974e653f1ed4557b12b462f19f04bf817553b Mon Sep 17 00:00:00 2001 From: HovorukhaBohdan Date: Thu, 26 Oct 2023 14:56:01 +0300 Subject: [PATCH] Fixed checkstyle --- src/main/java/core/basesyntax/Main.java | 13 ++++++++++--- .../java/core/basesyntax/db/dao/StorageDaoImpl.java | 1 - .../core/basesyntax/service/DataConvertService.java | 1 - .../core/basesyntax/service/DataProcessService.java | 1 - .../service/impl/CreateReportServiceImpl.java | 1 - .../service/impl/DataConvertServiceImpl.java | 1 - .../service/impl/DataProcessServiceImpl.java | 1 - .../service/impl/ReadFromCsvFileServiceImpl.java | 1 - .../service/impl/WriteToCsvFileServiceImpl.java | 1 - .../strategy/impl/FruitOperationStrategyImpl.java | 1 - .../service/impl/CreateReportServiceImplTest.java | 3 +-- .../service/impl/DataConvertServiceImplTest.java | 5 ++--- .../service/impl/DataProcessServiceImplTest.java | 11 ++++++----- .../service/impl/WriteToCsvFileServiceImplTest.java | 9 ++++----- .../impl/BalanceOperationHandlerImplTest.java | 9 +++++---- .../impl/FruitOperationStrategyImplTest.java | 10 +++++----- .../impl/PurchaseOperationHandlerImplTest.java | 7 ++++--- .../impl/ReturnOperationHandlerImplTest.java | 7 ++++--- .../impl/SupplyOperationHandlerImplTest.java | 7 ++++--- 19 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/main/java/core/basesyntax/Main.java b/src/main/java/core/basesyntax/Main.java index b40cdae55c..300d33c978 100644 --- a/src/main/java/core/basesyntax/Main.java +++ b/src/main/java/core/basesyntax/Main.java @@ -2,14 +2,21 @@ import core.basesyntax.model.FruitTransaction; import core.basesyntax.model.Operation; -import core.basesyntax.service.*; -import core.basesyntax.service.impl.*; +import core.basesyntax.service.CreateReportService; +import core.basesyntax.service.DataConvertService; +import core.basesyntax.service.DataProcessService; +import core.basesyntax.service.ReadFromCsvFileService; +import core.basesyntax.service.WriteToCsvFileService; +import core.basesyntax.service.impl.CreateReportServiceImpl; +import core.basesyntax.service.impl.DataConvertServiceImpl; +import core.basesyntax.service.impl.DataProcessServiceImpl; +import core.basesyntax.service.impl.ReadFromCsvFileServiceImpl; +import core.basesyntax.service.impl.WriteToCsvFileServiceImpl; import core.basesyntax.strategy.OperationHandler; import core.basesyntax.strategy.impl.BalanceOperationHandlerImpl; import core.basesyntax.strategy.impl.PurchaseOperationHandlerImpl; import core.basesyntax.strategy.impl.ReturnOperationHandlerImpl; import core.basesyntax.strategy.impl.SupplyOperationHandlerImpl; - import java.util.List; import java.util.Map; diff --git a/src/main/java/core/basesyntax/db/dao/StorageDaoImpl.java b/src/main/java/core/basesyntax/db/dao/StorageDaoImpl.java index 8e81d5ea3e..5819e6cb40 100644 --- a/src/main/java/core/basesyntax/db/dao/StorageDaoImpl.java +++ b/src/main/java/core/basesyntax/db/dao/StorageDaoImpl.java @@ -1,7 +1,6 @@ package core.basesyntax.db.dao; import core.basesyntax.db.Storage; - import java.util.Map; public class StorageDaoImpl implements StorageDao { diff --git a/src/main/java/core/basesyntax/service/DataConvertService.java b/src/main/java/core/basesyntax/service/DataConvertService.java index 7783268075..8f0caf4ff9 100644 --- a/src/main/java/core/basesyntax/service/DataConvertService.java +++ b/src/main/java/core/basesyntax/service/DataConvertService.java @@ -1,7 +1,6 @@ package core.basesyntax.service; import core.basesyntax.model.FruitTransaction; - import java.util.List; public interface DataConvertService { diff --git a/src/main/java/core/basesyntax/service/DataProcessService.java b/src/main/java/core/basesyntax/service/DataProcessService.java index 494fc36c31..aad34827bb 100644 --- a/src/main/java/core/basesyntax/service/DataProcessService.java +++ b/src/main/java/core/basesyntax/service/DataProcessService.java @@ -1,7 +1,6 @@ package core.basesyntax.service; import core.basesyntax.model.FruitTransaction; - import java.util.List; public interface DataProcessService { diff --git a/src/main/java/core/basesyntax/service/impl/CreateReportServiceImpl.java b/src/main/java/core/basesyntax/service/impl/CreateReportServiceImpl.java index 60b166a925..0c908749da 100644 --- a/src/main/java/core/basesyntax/service/impl/CreateReportServiceImpl.java +++ b/src/main/java/core/basesyntax/service/impl/CreateReportServiceImpl.java @@ -3,7 +3,6 @@ import core.basesyntax.db.dao.StorageDao; import core.basesyntax.db.dao.StorageDaoImpl; import core.basesyntax.service.CreateReportService; - import java.util.Map; public class CreateReportServiceImpl implements CreateReportService { diff --git a/src/main/java/core/basesyntax/service/impl/DataConvertServiceImpl.java b/src/main/java/core/basesyntax/service/impl/DataConvertServiceImpl.java index 7c05ecb227..73b48e7fa4 100644 --- a/src/main/java/core/basesyntax/service/impl/DataConvertServiceImpl.java +++ b/src/main/java/core/basesyntax/service/impl/DataConvertServiceImpl.java @@ -3,7 +3,6 @@ import core.basesyntax.model.FruitTransaction; import core.basesyntax.model.Operation; import core.basesyntax.service.DataConvertService; - import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/core/basesyntax/service/impl/DataProcessServiceImpl.java b/src/main/java/core/basesyntax/service/impl/DataProcessServiceImpl.java index cfca1d2377..f8ce34b389 100644 --- a/src/main/java/core/basesyntax/service/impl/DataProcessServiceImpl.java +++ b/src/main/java/core/basesyntax/service/impl/DataProcessServiceImpl.java @@ -8,7 +8,6 @@ import core.basesyntax.strategy.FruitOperationStrategy; import core.basesyntax.strategy.OperationHandler; import core.basesyntax.strategy.impl.FruitOperationStrategyImpl; - import java.util.List; import java.util.Map; diff --git a/src/main/java/core/basesyntax/service/impl/ReadFromCsvFileServiceImpl.java b/src/main/java/core/basesyntax/service/impl/ReadFromCsvFileServiceImpl.java index a6954691b1..6efe4e2e33 100644 --- a/src/main/java/core/basesyntax/service/impl/ReadFromCsvFileServiceImpl.java +++ b/src/main/java/core/basesyntax/service/impl/ReadFromCsvFileServiceImpl.java @@ -1,7 +1,6 @@ package core.basesyntax.service.impl; import core.basesyntax.service.ReadFromCsvFileService; - import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; diff --git a/src/main/java/core/basesyntax/service/impl/WriteToCsvFileServiceImpl.java b/src/main/java/core/basesyntax/service/impl/WriteToCsvFileServiceImpl.java index bd39eb76bb..74c50315e0 100644 --- a/src/main/java/core/basesyntax/service/impl/WriteToCsvFileServiceImpl.java +++ b/src/main/java/core/basesyntax/service/impl/WriteToCsvFileServiceImpl.java @@ -1,7 +1,6 @@ package core.basesyntax.service.impl; import core.basesyntax.service.WriteToCsvFileService; - import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; diff --git a/src/main/java/core/basesyntax/strategy/impl/FruitOperationStrategyImpl.java b/src/main/java/core/basesyntax/strategy/impl/FruitOperationStrategyImpl.java index 6abbab7e85..e63b611bfd 100644 --- a/src/main/java/core/basesyntax/strategy/impl/FruitOperationStrategyImpl.java +++ b/src/main/java/core/basesyntax/strategy/impl/FruitOperationStrategyImpl.java @@ -4,7 +4,6 @@ import core.basesyntax.model.Operation; import core.basesyntax.strategy.FruitOperationStrategy; import core.basesyntax.strategy.OperationHandler; - import java.util.Map; public class FruitOperationStrategyImpl implements FruitOperationStrategy { diff --git a/src/test/java/core/basesyntax/service/impl/CreateReportServiceImplTest.java b/src/test/java/core/basesyntax/service/impl/CreateReportServiceImplTest.java index 083b921ee3..23b64223a4 100644 --- a/src/test/java/core/basesyntax/service/impl/CreateReportServiceImplTest.java +++ b/src/test/java/core/basesyntax/service/impl/CreateReportServiceImplTest.java @@ -10,13 +10,12 @@ import core.basesyntax.service.DataConvertService; import core.basesyntax.service.DataProcessService; import core.basesyntax.service.ReadFromCsvFileService; -import java.util.Map; - import core.basesyntax.strategy.OperationHandler; import core.basesyntax.strategy.impl.BalanceOperationHandlerImpl; import core.basesyntax.strategy.impl.PurchaseOperationHandlerImpl; import core.basesyntax.strategy.impl.ReturnOperationHandlerImpl; import core.basesyntax.strategy.impl.SupplyOperationHandlerImpl; +import java.util.Map; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/core/basesyntax/service/impl/DataConvertServiceImplTest.java b/src/test/java/core/basesyntax/service/impl/DataConvertServiceImplTest.java index 3793b1e950..cbad574827 100644 --- a/src/test/java/core/basesyntax/service/impl/DataConvertServiceImplTest.java +++ b/src/test/java/core/basesyntax/service/impl/DataConvertServiceImplTest.java @@ -9,14 +9,13 @@ import core.basesyntax.service.DataConvertService; import core.basesyntax.service.DataProcessService; import core.basesyntax.service.ReadFromCsvFileService; -import java.util.List; -import java.util.Map; - import core.basesyntax.strategy.OperationHandler; import core.basesyntax.strategy.impl.BalanceOperationHandlerImpl; import core.basesyntax.strategy.impl.PurchaseOperationHandlerImpl; import core.basesyntax.strategy.impl.ReturnOperationHandlerImpl; import core.basesyntax.strategy.impl.SupplyOperationHandlerImpl; +import java.util.List; +import java.util.Map; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/core/basesyntax/service/impl/DataProcessServiceImplTest.java b/src/test/java/core/basesyntax/service/impl/DataProcessServiceImplTest.java index e7114c3d89..1f176d95be 100644 --- a/src/test/java/core/basesyntax/service/impl/DataProcessServiceImplTest.java +++ b/src/test/java/core/basesyntax/service/impl/DataProcessServiceImplTest.java @@ -1,5 +1,8 @@ package core.basesyntax.service.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + import core.basesyntax.db.Storage; import core.basesyntax.model.Operation; import core.basesyntax.service.DataConvertService; @@ -9,14 +12,11 @@ import core.basesyntax.strategy.impl.PurchaseOperationHandlerImpl; import core.basesyntax.strategy.impl.ReturnOperationHandlerImpl; import core.basesyntax.strategy.impl.SupplyOperationHandlerImpl; +import java.util.Map; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.*; - class DataProcessServiceImplTest { private static final String FIRST_FILENAME = "fruits1.csv"; private static final String SECOND_FILENAME = "fruits2.csv"; @@ -71,7 +71,8 @@ void dataProcessor_fourFruits_Ok() { @Test void dataProcessor_lessThenZero_NotOk() { assertThrows(RuntimeException.class, () -> - processor.processFruits(convertor.convert(reader.readFile(LESS_THEN_ZERO_FILENAME)))); + processor.processFruits(convertor.convert( + reader.readFile(LESS_THEN_ZERO_FILENAME)))); } @Test diff --git a/src/test/java/core/basesyntax/service/impl/WriteToCsvFileServiceImplTest.java b/src/test/java/core/basesyntax/service/impl/WriteToCsvFileServiceImplTest.java index 9be72197c5..47ffb456c3 100644 --- a/src/test/java/core/basesyntax/service/impl/WriteToCsvFileServiceImplTest.java +++ b/src/test/java/core/basesyntax/service/impl/WriteToCsvFileServiceImplTest.java @@ -9,16 +9,15 @@ import core.basesyntax.service.DataProcessService; import core.basesyntax.service.ReadFromCsvFileService; import core.basesyntax.service.WriteToCsvFileService; -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.util.Map; - import core.basesyntax.strategy.OperationHandler; import core.basesyntax.strategy.impl.BalanceOperationHandlerImpl; import core.basesyntax.strategy.impl.PurchaseOperationHandlerImpl; import core.basesyntax.strategy.impl.ReturnOperationHandlerImpl; import core.basesyntax.strategy.impl.SupplyOperationHandlerImpl; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.Map; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/core/basesyntax/strategy/impl/BalanceOperationHandlerImplTest.java b/src/test/java/core/basesyntax/strategy/impl/BalanceOperationHandlerImplTest.java index 8be3aad3c3..9f6785a39b 100644 --- a/src/test/java/core/basesyntax/strategy/impl/BalanceOperationHandlerImplTest.java +++ b/src/test/java/core/basesyntax/strategy/impl/BalanceOperationHandlerImplTest.java @@ -1,13 +1,14 @@ package core.basesyntax.strategy.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + import core.basesyntax.model.FruitTransaction; import core.basesyntax.model.Operation; import core.basesyntax.strategy.OperationHandler; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - class BalanceOperationHandlerImplTest { private static final int NORMAL_VALUE = 10; private static final int ZERO_VALUE = 0; @@ -44,6 +45,6 @@ void balanceOperationHandler_zeroValue_Ok() { @Test void balanceOperationHandler_lessThenZero_NotOk() { assertThrows(RuntimeException.class, () -> - balanceHandler.count(LESS_THEN_ZERO_TRANSACTION)); + balanceHandler.count(LESS_THEN_ZERO_TRANSACTION)); } -} \ No newline at end of file +} diff --git a/src/test/java/core/basesyntax/strategy/impl/FruitOperationStrategyImplTest.java b/src/test/java/core/basesyntax/strategy/impl/FruitOperationStrategyImplTest.java index aa5179aa3b..7525de8022 100644 --- a/src/test/java/core/basesyntax/strategy/impl/FruitOperationStrategyImplTest.java +++ b/src/test/java/core/basesyntax/strategy/impl/FruitOperationStrategyImplTest.java @@ -1,16 +1,16 @@ package core.basesyntax.strategy.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + import core.basesyntax.model.FruitTransaction; import core.basesyntax.model.Operation; import core.basesyntax.strategy.FruitOperationStrategy; import core.basesyntax.strategy.OperationHandler; +import java.util.Map; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.*; - class FruitOperationStrategyImplTest { private static final int NORMAL_VALUE = 10; private static final int ZERO_VALUE = 0; @@ -138,4 +138,4 @@ void strategyReturn_lessThenZero_NotOk() { assertThrows(RuntimeException.class, () -> fruitStrategy.countFruits(LESS_THEN_ZERO_RETURN_TRANSACTION)); } -} \ No newline at end of file +} diff --git a/src/test/java/core/basesyntax/strategy/impl/PurchaseOperationHandlerImplTest.java b/src/test/java/core/basesyntax/strategy/impl/PurchaseOperationHandlerImplTest.java index 3e89469190..9f4dafd3ec 100644 --- a/src/test/java/core/basesyntax/strategy/impl/PurchaseOperationHandlerImplTest.java +++ b/src/test/java/core/basesyntax/strategy/impl/PurchaseOperationHandlerImplTest.java @@ -1,13 +1,14 @@ package core.basesyntax.strategy.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + import core.basesyntax.model.FruitTransaction; import core.basesyntax.model.Operation; import core.basesyntax.strategy.OperationHandler; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - class PurchaseOperationHandlerImplTest { private static final int NORMAL_VALUE = 10; private static final int ZERO_VALUE = 0; @@ -46,4 +47,4 @@ void purchaseOperationHandler_lessThenZero_NotOk() { assertThrows(RuntimeException.class, () -> purchaseHandler.count(LESS_THEN_ZERO_TRANSACTION)); } -} \ No newline at end of file +} diff --git a/src/test/java/core/basesyntax/strategy/impl/ReturnOperationHandlerImplTest.java b/src/test/java/core/basesyntax/strategy/impl/ReturnOperationHandlerImplTest.java index fa2806c2aa..13129f1ae2 100644 --- a/src/test/java/core/basesyntax/strategy/impl/ReturnOperationHandlerImplTest.java +++ b/src/test/java/core/basesyntax/strategy/impl/ReturnOperationHandlerImplTest.java @@ -1,13 +1,14 @@ package core.basesyntax.strategy.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + import core.basesyntax.model.FruitTransaction; import core.basesyntax.model.Operation; import core.basesyntax.strategy.OperationHandler; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - class ReturnOperationHandlerImplTest { private static final int NORMAL_VALUE = 10; private static final int ZERO_VALUE = 0; @@ -46,4 +47,4 @@ void balanceOperationHandler_lessThenZero_NotOk() { assertThrows(RuntimeException.class, () -> returnHandler.count(LESS_THEN_ZERO_TRANSACTION)); } -} \ No newline at end of file +} diff --git a/src/test/java/core/basesyntax/strategy/impl/SupplyOperationHandlerImplTest.java b/src/test/java/core/basesyntax/strategy/impl/SupplyOperationHandlerImplTest.java index e4287f4c0d..b6e6dbb47e 100644 --- a/src/test/java/core/basesyntax/strategy/impl/SupplyOperationHandlerImplTest.java +++ b/src/test/java/core/basesyntax/strategy/impl/SupplyOperationHandlerImplTest.java @@ -1,13 +1,14 @@ package core.basesyntax.strategy.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + import core.basesyntax.model.FruitTransaction; import core.basesyntax.model.Operation; import core.basesyntax.strategy.OperationHandler; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - class SupplyOperationHandlerImplTest { private static final int NORMAL_VALUE = 10; private static final int ZERO_VALUE = 0; @@ -46,4 +47,4 @@ void balanceOperationHandler_lessThenZero_NotOk() { assertThrows(RuntimeException.class, () -> supplyHandler.count(LESS_THEN_ZERO_TRANSACTION)); } -} \ No newline at end of file +}