diff --git a/core-java/src/test/java/org/baeldung/java/enums/PizzaUnitTest.java b/core-java/src/test/java/org/baeldung/java/enums/PizzaUnitTest.java deleted file mode 100644 index bb3abff28d..0000000000 --- a/core-java/src/test/java/org/baeldung/java/enums/PizzaUnitTest.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.baeldung.java.enums; - -import static junit.framework.TestCase.assertTrue; - -import java.util.ArrayList; -import java.util.EnumMap; -import java.util.List; - -import org.junit.Test; - -import com.baeldung.enums.Pizza; - -public class PizzaUnitTest { - - @Test - public void givenPizaOrder_whenReady_thenDeliverable() { - Pizza testPz = new Pizza(); - testPz.setStatus(Pizza.PizzaStatusEnum.READY); - assertTrue(testPz.isDeliverable()); - } - - @Test - public void givenPizaOrders_whenRetrievingUnDeliveredPzs_thenCorrectlyRetrieved() { - List pzList = new ArrayList<>(); - Pizza pz1 = new Pizza(); - pz1.setStatus(Pizza.PizzaStatusEnum.DELIVERED); - - Pizza pz2 = new Pizza(); - pz2.setStatus(Pizza.PizzaStatusEnum.ORDERED); - - Pizza pz3 = new Pizza(); - pz3.setStatus(Pizza.PizzaStatusEnum.ORDERED); - - Pizza pz4 = new Pizza(); - pz4.setStatus(Pizza.PizzaStatusEnum.READY); - - pzList.add(pz1); - pzList.add(pz2); - pzList.add(pz3); - pzList.add(pz4); - - List undeliveredPzs = Pizza.getAllUndeliveredPizzas(pzList); - assertTrue(undeliveredPzs.size() == 3); - } - - @Test - public void givenPizaOrders_whenGroupByStatusCalled_thenCorrectlyGrouped() { - - List pzList = new ArrayList<>(); - Pizza pz1 = new Pizza(); - pz1.setStatus(Pizza.PizzaStatusEnum.DELIVERED); - - Pizza pz2 = new Pizza(); - pz2.setStatus(Pizza.PizzaStatusEnum.ORDERED); - - Pizza pz3 = new Pizza(); - pz3.setStatus(Pizza.PizzaStatusEnum.ORDERED); - - Pizza pz4 = new Pizza(); - pz4.setStatus(Pizza.PizzaStatusEnum.READY); - - pzList.add(pz1); - pzList.add(pz2); - pzList.add(pz3); - pzList.add(pz4); - - EnumMap> map = Pizza.groupPizzaByStatus(pzList); - assertTrue(map.get(Pizza.PizzaStatusEnum.DELIVERED).size() == 1); - assertTrue(map.get(Pizza.PizzaStatusEnum.ORDERED).size() == 2); - assertTrue(map.get(Pizza.PizzaStatusEnum.READY).size() == 1); - } - - @Test - public void givenPizaOrder_whenDelivered_thenPizzaGetsDeliveredAndStatusChanges() { - Pizza pz = new Pizza(); - pz.setStatus(Pizza.PizzaStatusEnum.READY); - pz.deliver(); - assertTrue(pz.getStatus() == Pizza.PizzaStatusEnum.DELIVERED); - } - -}