test: add integration tests for JDBC repositories #15
+8
-7
@@ -61,13 +61,14 @@ class FilmLibraryRepositoryIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `should save new film library entry and return saved entry`() {
|
fun `should save new film library entry and return saved entry`() {
|
||||||
val entry = FilmLibrary(
|
val entry =
|
||||||
id = UUID.randomUUID(),
|
FilmLibrary(
|
||||||
userId = testUser.id,
|
id = UUID.randomUUID(),
|
||||||
filmId = testFilm.id,
|
userId = testUser.id,
|
||||||
comment = "Отличный фильм!",
|
filmId = testFilm.id,
|
||||||
isViewed = false,
|
comment = "Отличный фильм!",
|
||||||
)
|
isViewed = false,
|
||||||
|
)
|
||||||
|
|
||||||
val savedEntry = filmLibraryRepository.save(entry)
|
val savedEntry = filmLibraryRepository.save(entry)
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -41,11 +41,12 @@ class FilmRepositoryIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `should save new film and return saved film`() {
|
fun `should save new film and return saved film`() {
|
||||||
val film = Film(
|
val film =
|
||||||
id = UUID.randomUUID(),
|
Film(
|
||||||
title = "Начало",
|
id = UUID.randomUUID(),
|
||||||
description = "Захватывающий триллер о снах внутри снов",
|
title = "Начало",
|
||||||
)
|
description = "Захватывающий триллер о снах внутри снов",
|
||||||
|
)
|
||||||
|
|
||||||
val savedFilm = filmRepository.save(film)
|
val savedFilm = filmRepository.save(film)
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -41,12 +41,13 @@ class UserRepositoryIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `should save new user and return saved user`() {
|
fun `should save new user and return saved user`() {
|
||||||
val user = User(
|
val user =
|
||||||
id = UUID.randomUUID(),
|
User(
|
||||||
name = "John Doe",
|
id = UUID.randomUUID(),
|
||||||
email = "john@example.com",
|
name = "John Doe",
|
||||||
library = null,
|
email = "john@example.com",
|
||||||
)
|
library = null,
|
||||||
|
)
|
||||||
|
|
||||||
val savedUser = userRepository.save(user)
|
val savedUser = userRepository.save(user)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user