Skip to content

Commit

Permalink
checkstyle fix
Browse files Browse the repository at this point in the history
  • Loading branch information
don-bigdad committed Sep 18, 2023
1 parent 59ac7b4 commit fbe8036
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
import core.basesyntax.db.Storage;
import core.basesyntax.model.Fruit;
import core.basesyntax.model.FruitTransaction;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

class BalanceOperationHandlerTest {
private static Fruit apple;
private static OperationHandler balanceOperationHandler;
private static FruitTransaction fruitTransaction;

@BeforeAll
static void setUp() {
apple = new Fruit("apple");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class PurchaseOperationHandlerTest {
private static Fruit apple;
private static OperationHandler purchaseOperationHandler;
private static FruitTransaction fruitTransaction;

@BeforeAll
static void setUp() {
apple = new Fruit("apple");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
import core.basesyntax.db.Storage;
import core.basesyntax.model.Fruit;
import core.basesyntax.model.FruitTransaction;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

class ReturnOperationHandlerTest {
private static Fruit apple;
private static OperationHandler returnOperationHandler;
private static FruitTransaction fruitTransaction;

@BeforeAll
static void setUp() {
apple = new Fruit("apple");
returnOperationHandler = new ReturnOperationHandler();
fruitTransaction = new FruitTransaction();
Storage.storage.clear();
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import core.basesyntax.db.Storage;
import core.basesyntax.model.Fruit;
import core.basesyntax.model.FruitTransaction;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

class SupplyOperationHandlerTest {
private static Fruit apple;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class OperationProcessorServiceTest {
private static Map<FruitTransaction.Operation, OperationHandler> handlerMap;
private static Fruit banana;
private static Fruit apple;

@BeforeAll
static void beforeAll() {
banana = new Fruit("banana");
Expand All @@ -38,8 +39,8 @@ static void beforeAll() {

@Test
void processValidTransactions() {
int initialBananaBalance = Storage.storage.get(banana);
int initialAppleBalance = Storage.storage.get(apple);
final int initialBananaBalance = Storage.storage.get(banana);
final int initialAppleBalance = Storage.storage.get(apple);
int quantity = 25;
FruitTransaction transaction1 = new FruitTransaction();
transaction1.setFruit(banana);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ReportServiceImplTest {
@BeforeEach
void setUp() {
reportService = new ReportServiceImpl();
Storage.storage.clear();
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ static void setUp() {
outputValidator = new OutputValidatorImpl();
}


@Test
void validFileValidation_Ok() {
String validFileForTest = "src/test/java/resources/OutputValidatorValidTest.csv";
Expand All @@ -37,7 +36,7 @@ void invalidQuantity_NotOk() {

@Test
void noDataInFile_NotOk() {
String noDataFile = "src/test/java/resources/NullFile.csv";
String noDataFile = "src/test/java/resources/NullFile.csv";
Assert.assertThrows(RuntimeException.class,
() -> outputValidator.validateFile(noDataFile));
}
Expand Down

0 comments on commit fbe8036

Please sign in to comment.