added last test

This commit is contained in:
VictoriaPresnyakova 2023-04-15 19:19:48 +04:00
parent ee092b86e1
commit aed4d6605d
2 changed files with 15 additions and 0 deletions

Binary file not shown.

View File

@ -45,6 +45,7 @@ class SbappApplicationTests {
Assertions.assertThrows(EntityNotFoundException.class, () -> orderService.findOrder(order0.getId()));
}
@Test
void testFavor(){
componentService.deleteAllComponent();
@ -66,4 +67,18 @@ class SbappApplicationTests {
Assertions.assertThrows(EntityNotFoundException.class, () -> favorService.findFavor(favor0.getId()));
}
@Test
void testComponent(){
componentService.deleteAllComponent();
orderService.deleteAllOrder();
favorService.deleteAllFavor();
final Component component0 = componentService.addComponent("comp", 111);
final Component component1 = componentService.findComponent(component0.getId());
Assertions.assertEquals(component0, component1);
componentService.deleteComponent(component0.getId());
Assertions.assertThrows(EntityNotFoundException.class, () -> componentService.findComponent(component0.getId()));
}
}