diff --git a/src/test/java/com/labwork1/app/JpaCustomerTests.java b/src/test/java/com/labwork1/app/JpaCustomerTests.java index 97ed41c..7f405e1 100644 --- a/src/test/java/com/labwork1/app/JpaCustomerTests.java +++ b/src/test/java/com/labwork1/app/JpaCustomerTests.java @@ -63,9 +63,7 @@ public class JpaCustomerTests { Assertions.assertThrows(EntityNotFoundException.class, () -> orderService.findOrder(-1L)); // 2 покупателя final Customer customer2 = customerService.addCustomer("Иннокентий", "Иванов"); - // 3 сеанса - final Session session3 = sessionService.addSession(300.0, - new Timestamp(System.currentTimeMillis()), cinema2.getId()); + // 1 заказ final Order order2 = orderService .addOrder(customerService.findCustomer(customer2.getId())); @@ -75,6 +73,9 @@ public class JpaCustomerTests { // у заказа 1 сеанс orderService.deleteSessionInOrder(order2.getId(), session2.getId()); // у заказа 0 сеансов + // 3 сеанса + final Session session3 = sessionService.addSession(300.0, + new Timestamp(System.currentTimeMillis()), cinema2.getId()); // осталось 2 сеанса sessionService.deleteSession(session1.getId()); Assertions.assertEquals(sessionService.findAllSessions().size(), 2);