ого вау работает

This commit is contained in:
dasha 2023-03-27 23:05:30 +04:00
parent 0434d1b3b8
commit f1b09d7994

View File

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