diff --git a/.idea/Product-Inventory-Lab.iml b/.idea/Product-Inventory-Lab.iml new file mode 100644 index 0000000..78b2cc5 --- /dev/null +++ b/.idea/Product-Inventory-Lab.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 7a4bf35..4f08829 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,6 +6,7 @@ + diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/chocolate.json b/chocolate.json new file mode 100644 index 0000000..84793c3 --- /dev/null +++ b/chocolate.json @@ -0,0 +1,7 @@ +[ { + "id" : 1, + "brand" : "cornetto", + "type" : "ice cream", + "quantity" : 5, + "price" : 10.0 +} ] \ No newline at end of file diff --git a/instructions/section-03.md b/instructions/section-03.md index 54e535e..cfed147 100644 --- a/instructions/section-03.md +++ b/instructions/section-03.md @@ -9,12 +9,12 @@ Now that we have production models and services to manage them we can pull every * Create a user interface to create, read, update and delete products ## Part 1 - Input Output -We will need to allow user input in order for the application to function. In order to do this we will use the Scanner class to accept input and methods from the System.out package to print to the console. In order to keep our code a bit cleaner as well as add a layer of abstraction we will use a Console class. +We will need to allow user input in order for the application to function. In order to do this we will use the Scanner class to accept input and methods from the System.out package to print to the console. In order to keep our code a bit cleaner as well as add a layer of abstraction we will use a io class. ``` package io; -public class Console { +public class io { } ``` @@ -24,7 +24,7 @@ Notice that I've added this to an _io_ package. Now we can keep repetitious System.out and Scanner calls out of the main application code. We can also use this class to print large output strings that would bloat our code. ``` -public class Console { +public class io { public static void printWelcome(){ System.out.println("" + "**************************************************" + @@ -40,10 +40,10 @@ public class Console { Having this print line string in the code is large and litters up the main code. Having it abstracted away alows us to keep the main code clean and easy to read. We will simply call the _printWelcome()_ behaviour wherever we want to call this code. ``` -Console.printWelcome() +io.printWelcome() ``` -Whenever we want to capture user input or display output we will create methods in the Console class to handle these behaviours. +Whenever we want to capture user input or display output we will create methods in the io class to handle these behaviours. ## Part 2 - Application class Now it is time to put all of these classes we have created to work. We will begin by creating a App class to initialize the application logic and initialize the services. This is the top most class and will start the program @@ -76,7 +76,7 @@ public class App { // (4) // application logic here // call methods to take user input and interface with services - Console.printWelcome(); + io.printWelcome(); } } ``` @@ -97,7 +97,7 @@ Now that we have a way to start the application, create the rest of the code to ## Conclusion -Creating a Console class allowed us to abstract away user interface components of the code. Now the main code isn't concerned with how UI is done, it is only concerned with what it does. We created an application class to house the elements of the program. Finally, creating a user interface to allow a user to interact (Create, Read, Update, and Delete) with items in the inventory. +Creating a io class allowed us to abstract away user interface components of the code. Now the main code isn't concerned with how UI is done, it is only concerned with what it does. We created an application class to house the elements of the program. Finally, creating a user interface to allow a user to interact (Create, Read, Update, and Delete) with items in the inventory. diff --git a/pom.xml b/pom.xml index 43c1af2..37f78ce 100644 --- a/pom.xml +++ b/pom.xml @@ -21,5 +21,24 @@ + + + org.junit.jupiter + junit-jupiter-engine + 5.4.2 + test + + + org.junit.jupiter + junit-jupiter-api + 5.4.2 + test + + + com.fasterxml.jackson.core + jackson-databind + 2.10.1 + + - \ No newline at end of file + diff --git a/src/main/java/Models/Chocolate.java b/src/main/java/Models/Chocolate.java new file mode 100644 index 0000000..03fd16b --- /dev/null +++ b/src/main/java/Models/Chocolate.java @@ -0,0 +1,59 @@ +package Models; + +public class Chocolate { + private int id; +private String brand; +private String type; +private int quantity; +private float price; + +public Chocolate(){ +} + + public Chocolate(int id,String brand,String type,int quantity,float price){ + this.brand=brand; + this.id = id; + this.type=type; + this.quantity=quantity; + this.price=price; + } + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public float getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } +} diff --git a/src/main/java/Models/Clothing.java b/src/main/java/Models/Clothing.java new file mode 100644 index 0000000..6106650 --- /dev/null +++ b/src/main/java/Models/Clothing.java @@ -0,0 +1,75 @@ +package Models; + +public class Clothing { + private int id; + private String name; + private String brand; + private int size; + private int quantity; + private float price; + + public Clothing(int id,String name,String brand,int size,int quantity,float price){ + this.id=id; + this.name=name; + this.brand=brand; + this.size=size; + this.quantity=quantity; + this.price=price; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public float getPrice() { + return price; + } + + public void setPrice(float price) { + this.price = price; + } + + public Clothing() + {} + + + + +public String getName(){ + return name; + } + +} + diff --git a/src/main/java/Services/ChocolateService.java b/src/main/java/Services/ChocolateService.java new file mode 100644 index 0000000..606f6f5 --- /dev/null +++ b/src/main/java/Services/ChocolateService.java @@ -0,0 +1,123 @@ +package Services; + +import Models.Chocolate; +import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectWriter; +import utils.CSVUtils; + +import java.io.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ChocolateService { + private static int nextId=1; + private ArrayList inventory = new ArrayList<>(); + + + + public Chocolate create(String brand,String type,int quantity,float price){ + + Chocolate createdChocolate = new Chocolate(nextId++,brand,type,quantity,price); + + inventory.add(createdChocolate); + + return createdChocolate; + } + + public Chocolate findChocolate(String brand) { + for (Chocolate findObject : inventory) { + if (findObject.getBrand().equals(brand)) { + return findObject; + } + } return null; + } + + public Chocolate[] findAll(){ +// ArrayList inventoryClone =(ArrayList) inventory.clone(); +// return (Chocolate[]) inventoryClone.toArray(); + return inventory.toArray(new Chocolate[0]); + } + + public Boolean update(String brand,Integer quantity){ + for(Chocolate updateQuantity:inventory){ + if(updateQuantity.getBrand().equals(brand)){ + updateQuantity.setQuantity(quantity); + return true; + } + } + return false; + } + public boolean delete(String brand){ + for(Chocolate deleteObject : inventory){ + if(deleteObject.getBrand().equals(brand)){ + return true; + } + } + return false; + } + + public void writeCSVUtils() throws IOException { + String csvFile = "/Users/batman/Desktop/Chocolate.csv"; + FileWriter writer = new FileWriter(csvFile); //(1) + + CSVUtils.writeLine(writer, new ArrayList(Arrays.asList(String.valueOf(nextId)))); // (2) + + for (Chocolate s : inventory) { + List list = new ArrayList<>(); // (3) + // list.add(String.valueOf(s.getId())); + list.add(s.getBrand()); + list.add(s.getType()); + // list.add(s.getSport()); + list.add(String.valueOf(s.getQuantity())); + list.add(String.valueOf(s.getPrice())); + + CSVUtils.writeLine(writer, list); // (4) + } + writer.flush(); + writer.close(); + } + + private void loadData(){ + // (1) + String csvFile = "/Users/batman/Desktop/Chocolate.csv"; + String line = ""; + String csvSplitBy = ","; + + // (2) + try (BufferedReader br = new BufferedReader(new FileReader(csvFile))) { + nextId = Integer.parseInt(br.readLine()); // (3) + + while ((line = br.readLine()) != null) { + // split line with comma + String[] candy = line.split(csvSplitBy); + + // (4) + int id = Integer.parseInt(candy[0]); + String type = candy[1]; + String brand = candy[2]; + // int quantity = candy[5]; + int quantity = Integer.parseInt(candy[3]); + float price = Float.parseFloat(candy[4]); + + // (5) + inventory.add(new Chocolate(id, type,brand, quantity, price)); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + public ArrayList readJson() throws IOException { + ObjectMapper objectMapper = new ObjectMapper(); + this.inventory = objectMapper.readValue(new File("chocolate.json"), new TypeReference>(){}); + return this.inventory; + } + public void writeJson() throws IOException { + ObjectMapper mapper = new ObjectMapper(); + ObjectWriter writer = mapper.writer(new DefaultPrettyPrinter()); + writer.writeValue(new File("chocolate.json"), inventory); + } +} diff --git a/src/main/java/Services/ClothingService.java b/src/main/java/Services/ClothingService.java new file mode 100644 index 0000000..df1b8b9 --- /dev/null +++ b/src/main/java/Services/ClothingService.java @@ -0,0 +1,46 @@ +package Services; + +import Models.Clothing; + +import java.util.ArrayList; + +public class ClothingService { + + private static int nextId=1; + private ArrayList inventory = new ArrayList<>(); + + + +public Clothing create(String name,String brand,int size,int quantity,float price){ + + Clothing createdClothing = new Clothing(nextId++,name,brand,size,quantity,price); + + inventory.add(createdClothing); + + return createdClothing; +} + +public Clothing findClothing(int id) { + for (Clothing findObject : inventory) { + if (findObject.getId() == id) { + return findObject; + } + } return null; +} + +public Clothing[] findAll(){ + +// ArrayList inventoryClone =(ArrayList) inventory.clone(); +// return (Clothing[]) inventoryClone.toArray(); + return inventory.toArray(new Clothing[0]); + +} +public boolean delete(int id){ +for(Clothing deleteObject : inventory){ + if(deleteObject.getId()==id){ + return true; + } +} +return false; +} +} diff --git a/src/main/java/io/App.java b/src/main/java/io/App.java new file mode 100644 index 0000000..c05da9e --- /dev/null +++ b/src/main/java/io/App.java @@ -0,0 +1,115 @@ +package io; + +import Models.Chocolate; +import Models.Clothing; +import Services.ChocolateService; +import Services.ClothingService; + +import java.io.IOException; +import java.util.ArrayList; + +public class App { + //instantiation + private ClothingService clothingService = new ClothingService(); // (1) + private ChocolateService chocolateService =new ChocolateService(); + private Chocolate chocolate=new Chocolate(); + private Clothing clothing = new Clothing(); + + public static void main(String... args) throws IOException { + + + App application = new App(); // (2) + application.init(); // (3) + + + } + + public void init() throws IOException { + // (4) + // application logic here + // call methods to take user input and interface with services + Console.printWelcome(); + String brand=""; + String type =""; + int quantity=0; + float price=0; + Boolean exitProgram=false; + + do{ + String options = Console.getStringInput("Choose an option\n" + + "1.Create chocolate\n" + + "2.Read Inventory of \n" + + "3.Update Product \n" + + "4.Delete Product \n" + + "5.Save to Json \n"+ + "6.Read from Json \n"+ + "7.Exit the program \n"); + + + switch (options) { + case "1": + Console.println("Enter Chocolate details:"); + + + brand = Console.getStringInput("Enter brand"); + type = Console.getStringInput("Enter type"); + quantity = Console.getIntegerInput("Enter quantity"); + price = Console.getIntegerInput("Enter price"); + + chocolateService.create(brand, type, quantity, price); + Console.println("Chocolate inventory :" + brand + " created"); + break; + + case "2": + brand = Console.getStringInput("Enter brand to find inventory of chocolate:"); + chocolate = chocolateService.findChocolate(brand); + Console.println("Product details: brand: "+chocolate.getBrand() + + " quantity: "+chocolate.getQuantity()+" price: "+chocolate.getPrice()); + break; + + case "3": + brand = Console.getStringInput("Enter brand to update inventory"); + quantity=Console.getIntegerInput("Enter the quantity you want to update:"); + Boolean updateQty = chocolateService.update(brand,quantity); + if(updateQty==true){ + Console.println("Quantity updated"); + } + else Console.println("Product not found"); + break; + + case "4": + brand = Console.getStringInput("Enter the brand of the product you want to delete:"); + Boolean checkDelete = chocolateService.delete(brand); + if(checkDelete==true){ + Console.println("Product Deleted"); + } + else Console.println("Product not found"); + break; + case "5": + chocolateService.writeJson(); + Console.println("Value saved to chocolate.json"); + break; + case "6": + ArrayList chocolates = chocolateService.readJson(); + //chocolateService.in + for (Chocolate s:chocolates + ) { + Console.println("Brand:"+s.getBrand()+"\n"); + Console.println("Type:"+s.getType()+"\n"); + Console.println("Quantity:"+s.getQuantity()+"\n"); + Console.println("Price:"+s.getPrice()+"\n"); + } + + break; + + case "7": + exitProgram=true; + Console.println("Program Exited:Goodbye"); + break; + + } + } + while(exitProgram==false); + } + } + diff --git a/src/main/java/io/Console.java b/src/main/java/io/Console.java new file mode 100644 index 0000000..c5ab6a8 --- /dev/null +++ b/src/main/java/io/Console.java @@ -0,0 +1,43 @@ +package io; + +import java.util.Scanner; + +public class Console { + public static void printWelcome(){ + System.out.println("" + + "**************************************************" + + "*** Welcome and Bienvenue ***" + + "*** to ***" + + "*** ZipCo Inventory Manager ***" + + "**************************************************"); + } + public static void print(String output, Object... args) { + System.out.printf(output, args); + } + + public static void println(String output, Object... args) { + print(output + "\n", args); + } + + public static String getStringInput(String prompt) { + Scanner scanner = new Scanner(System.in); + println(prompt); + String userInput = scanner.nextLine(); + return userInput; + } + public static Integer getIntegerInput(String prompt) { + Scanner scanner = new Scanner(System.in); + println(prompt); + Integer userInput = 0; + try { + userInput = scanner.nextInt(); + } + catch (Exception e) + { + System.out.println("Enter a valid number!"); + } + return userInput; + } + + +} diff --git a/src/main/java/utils/CSVUtils.java b/src/main/java/utils/CSVUtils.java new file mode 100644 index 0000000..36a5b94 --- /dev/null +++ b/src/main/java/utils/CSVUtils.java @@ -0,0 +1,29 @@ +package utils; + +import java.io.IOException; +import java.io.Writer; +import java.util.List; + +public class CSVUtils { + private static final char DEFAULT_SEPARATOR = ','; // (1) + + // (2) + public static void writeLine(Writer w, List values) throws IOException { + boolean first = true; + + StringBuilder sb = new StringBuilder(); + + // (3) + for (String value : values) { + if (!first) { + sb.append(DEFAULT_SEPARATOR); + } + sb.append(value); + first = false; + } + sb.append("\n"); + + w.append(sb.toString()); // (4) + } +} + diff --git a/src/test/java/Models/ChocolateTest.java b/src/test/java/Models/ChocolateTest.java new file mode 100644 index 0000000..efec085 --- /dev/null +++ b/src/test/java/Models/ChocolateTest.java @@ -0,0 +1,48 @@ +package Models; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class ChocolateTest { + + @BeforeEach + void setUp() { + } + + @AfterEach + void tearDown() { + } +@Test +public void testSetName(){ + //given + String expectedBrand="Munch"; + //when + Chocolate chocolate=new Chocolate(); + chocolate.setBrand(expectedBrand); + //then + Assertions.assertEquals(expectedBrand,chocolate.getBrand()); +} + +@Test + public void testConstructor(){ + //given + String expectedBrand="Munch"; + String type="Wafer"; + int quantity=10; + float price=5; + + //when + Chocolate chocolate=new Chocolate(); + + //then + Assertions.assertEquals(expectedBrand,chocolate.getBrand()); + Assertions.assertEquals(type,chocolate.getType()); + Assertions.assertEquals(quantity,chocolate.getQuantity()); + Assertions.assertEquals(price,chocolate.getPrice()); +} + +} \ No newline at end of file diff --git a/src/test/java/Models/ClothingTest.java b/src/test/java/Models/ClothingTest.java new file mode 100644 index 0000000..cf06bab --- /dev/null +++ b/src/test/java/Models/ClothingTest.java @@ -0,0 +1,56 @@ +package Models; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import sun.jvm.hotspot.utilities.Assert; + + +class ClothingTest { + + @BeforeEach + void setUp() { + } + + @AfterEach + void tearDown() { + } + + @Test + public void testSetName(){ + //Given + String expectedName ="Jean"; + //When + Clothing clothing =new Clothing(); + clothing.setName(expectedName); + //Then + Assertions.assertEquals(expectedName,clothing.getName()); + + + } + + @Test + public void testConstructor(){ + //Given + int id=112; + String expectedName ="Jean"; + String brand="Levis"; + int size=6; + int quantity=10; + float price=35; + //When + Clothing clothing =new Clothing(id,expectedName,brand,size,quantity,price); + //clothing.setName(expectedName); + //Then + Assertions.assertEquals(expectedName,clothing.getName()); + Assertions.assertEquals(id,clothing.getId()); + Assertions.assertEquals(brand,clothing.getBrand()); + Assertions.assertEquals(size,clothing.getSize()); + Assertions.assertEquals(quantity,clothing.getQuantity()); + Assertions.assertEquals(price,clothing.getPrice()); + + + + } +} \ No newline at end of file diff --git a/src/test/java/Services/ChocolateServiceTest.java b/src/test/java/Services/ChocolateServiceTest.java new file mode 100644 index 0000000..19afc58 --- /dev/null +++ b/src/test/java/Services/ChocolateServiceTest.java @@ -0,0 +1,104 @@ +package Services; + +import Models.Chocolate; +import Models.Clothing; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.lang.reflect.Array; + +import static org.junit.jupiter.api.Assertions.*; + +class ChocolateServiceTest { + + @BeforeEach + void setUp() { + } + + @AfterEach + void tearDown() { + } + + @Test + public void createTest(){ + + String expectedBrand="Kit Kat"; + String expectedType ="Bar"; + int expectedQuantity=10; + float expectedPrice=5; + + ChocolateService chocolateService = new ChocolateService(); + Chocolate testChocolate = chocolateService.create(expectedBrand,expectedType,expectedQuantity,expectedPrice); + + + String actualBrand = testChocolate.getBrand(); + String actualType = testChocolate.getType(); + int actualQuantity = testChocolate.getQuantity(); + float actualPrice = testChocolate.getPrice(); + + //Assertions.assertEquals(Integer.class.getName(), new Integer(actualId).getClass().getName()); + Assertions.assertEquals(expectedBrand, actualBrand); + Assertions.assertEquals(expectedType, actualType); + Assertions.assertEquals(expectedQuantity, actualQuantity); + Assertions.assertEquals(expectedPrice, actualPrice); + + } + + @Test + void findChocolate() { + //Given + ChocolateService chocolateService = new ChocolateService(); + Chocolate chocolate = new Chocolate(); + chocolateService.create("Munch","wafer",10,5); + chocolateService.create("Kit kat","bar",20,10); + //When + chocolate = chocolateService.findChocolate("Munch"); + + //Then + Assertions.assertEquals("Munch", chocolate.getBrand()); + + } + + @Test + void findAll() { + //Given + ChocolateService chocolateService = new ChocolateService(); + //Clothing foundClothing = new Clothing(); + chocolateService.create("Munch","wafer",10,5); + chocolateService.create("Kit kat","bar",20,10); + //When + Chocolate[] chocolates = chocolateService.findAll(); + //Then + Assertions.assertEquals(2,chocolates.length); + //Assertions.assertTrue(true); + } + + @Test + void delete() { + //Given + ChocolateService chocolateService = new ChocolateService(); + Boolean chocolateDeleted = true; + chocolateService.create("Munch","wafer",10,5); + chocolateService.create("Kit kat","bar",20,10); + //When + chocolateDeleted = chocolateService.delete("Munch"); + //Then + Assertions.assertEquals(true, chocolateDeleted); + } + + @Test + void update() { + //given + ChocolateService chocolateService=new ChocolateService(); + Boolean chocolateUpdated = true; + chocolateService.create("cornetto","ice cream",5,5); + + //when + chocolateUpdated=chocolateService.update("cornetto",10); + + //then + Assertions.assertEquals(true,chocolateUpdated); + } +} \ No newline at end of file diff --git a/src/test/java/Services/ClothingServiceTest.java b/src/test/java/Services/ClothingServiceTest.java new file mode 100644 index 0000000..3ee2274 --- /dev/null +++ b/src/test/java/Services/ClothingServiceTest.java @@ -0,0 +1,88 @@ +package Services; + +import Models.Clothing; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class ClothingServiceTest { + + @BeforeEach + void setUp() { + } + + @AfterEach + void tearDown() { + } + + @Test + public void createTest(){ + //int expectedId=112; + String expectedName ="Jean"; + String expectedBrand="Levis"; + int expectedSize=6; + int expectedQuantity=10; + float expectedPrice=35; + + ClothingService clothingService = new ClothingService(); + Clothing testClothing = clothingService.create(expectedName,expectedBrand,expectedSize,expectedQuantity,expectedPrice); + + int actualId = testClothing.getId(); + String actualName = testClothing.getName();; + String actualBrand = testClothing.getBrand();; + int actualSize = testClothing.getSize(); + int actualQuantity = testClothing.getQuantity(); + float actualPrice = testClothing.getPrice(); + + //Assertions.assertEquals(Integer.class.getName(), new Integer(actualId).getClass().getName()); + Assertions.assertEquals(expectedName, actualName); + Assertions.assertEquals(expectedBrand, actualBrand); + Assertions.assertEquals(expectedSize, actualSize); + Assertions.assertEquals(expectedQuantity, actualQuantity); + Assertions.assertEquals(expectedPrice, actualPrice); + + } + + @Test + void findClothing() { + //Given + ClothingService clothingService = new ClothingService(); + Clothing clothing = new Clothing(); + clothingService.create("Dress","Gucci",6,10,300); + clothingService.create("Jeans","Levis",10,8,45); + //When + clothing = clothingService.findClothing(2); + //Then + Assertions.assertEquals("Levis",clothing.getBrand()); + + } + + @Test + void findAll() { + //Given + ClothingService clothingService = new ClothingService(); + //Clothing foundClothing = new Clothing(); + clothingService.create("Shirt","Arrow",32,10,30); + clothingService.create("Jeans","Levis",32,8,42); + //When + Clothing [] clothing = clothingService.findAll(); + //Then + Assertions.assertTrue(true); + } + + @Test + void delete() { + //Given + ClothingService clothingService = new ClothingService(); + Boolean isClotheDeleted = true; + clothingService.create("Shirt","Arrow",32,10,30); + clothingService.create("Jeans","Levis",32,8,42); + //When + isClotheDeleted = clothingService.delete(2); + //Then + Assertions.assertEquals(true, isClotheDeleted); + } +} \ No newline at end of file