LabWork02 Fixes

This commit is contained in:
parent 3e9d61d071
commit e11781e6c1
8 changed files with 30 additions and 0 deletions

View File

@ -56,4 +56,9 @@ public class ItemService {
final ItemEntity existsEntity = get(id);
return repository.delete(existsEntity);
}
// Удалить все элементы
public void deleteAll() {
repository.deleteAll();
}
}

View File

@ -55,4 +55,9 @@ public class MessageService {
final MessageEntity existsEntity = get(id);
return repository.delete(existsEntity);
}
// Удалить все элементы
public void deleteAll() {
repository.deleteAll();
}
}

View File

@ -48,4 +48,9 @@ public class TypeService {
final TypeEntity existsEntity = get(id);
return repository.delete(existsEntity);
}
// Удалить все элементы
public void deleteAll() {
repository.deleteAll();
}
}

View File

@ -50,4 +50,9 @@ public class UserService {
final UserEntity existsEntity = get(id);
return repository.delete(existsEntity);
}
// Удалить все элементы
public void deleteAll() {
repository.deleteAll();
}
}

View File

@ -65,5 +65,8 @@ public class ItemServiceTests {
final ItemEntity newEntity = itemService.create(new ItemEntity(null, type, 50.00, 10));
Assertions.assertEquals(3, itemService.getAll(0L).size());
Assertions.assertEquals(4L, newEntity.getId());
typeService.deleteAll();
itemService.deleteAll();
}
}

View File

@ -67,5 +67,8 @@ public class MessageServiceTests {
final MessageEntity newEntity = messageService.create(new MessageEntity(null, sender, "Message", LocalDateTime.now(), false));
Assertions.assertEquals(3, messageService.getAll(0L).size());
Assertions.assertEquals(4L, newEntity.getId());
userService.deleteAll();
messageService.deleteAll();
}
}

View File

@ -59,5 +59,7 @@ class TypeServiceTests {
final TypeEntity newEntity = typeService.create(new TypeEntity(null, "Infinity"));
Assertions.assertEquals(3, typeService.getAll().size());
Assertions.assertEquals(4L, newEntity.getId());
typeService.deleteAll();
}
}

View File

@ -61,5 +61,7 @@ public class UserServiceTests {
final UserEntity newEntity = userService.create(new UserEntity(null, "User4", "password4", "mail4@gmail.com"));
Assertions.assertEquals(3, userService.getAll().size());
Assertions.assertEquals(4L, newEntity.getId());
userService.deleteAll();
}
}