style(format): reformatted with ktlint
This commit is contained in:
+30
-29
@@ -9,17 +9,17 @@ import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNull
|
||||
|
||||
class UserEntityMappingTest {
|
||||
|
||||
@Test
|
||||
fun `toDomain maps UserEntity correctly`() {
|
||||
val entity = UserEntity(
|
||||
id = UUID.randomUUID(),
|
||||
name = "John Pork",
|
||||
email = "john@email.com",
|
||||
provider = "GOOGLE",
|
||||
providerId = "google1234",
|
||||
createdAt = LocalDateTime.now(),
|
||||
)
|
||||
val entity =
|
||||
UserEntity(
|
||||
id = UUID.randomUUID(),
|
||||
name = "John Pork",
|
||||
email = "john@email.com",
|
||||
provider = "GOOGLE",
|
||||
providerId = "google1234",
|
||||
createdAt = LocalDateTime.now(),
|
||||
)
|
||||
val user = entity.toDomain()
|
||||
|
||||
assertEquals(entity.id, user.id)
|
||||
@@ -30,12 +30,13 @@ class UserEntityMappingTest {
|
||||
|
||||
@Test
|
||||
fun `toEntity maps User with OAuth provider`() {
|
||||
val user = User(
|
||||
id = UUID.randomUUID(),
|
||||
name = "Jane",
|
||||
email = "jane@mail.com",
|
||||
library = null
|
||||
)
|
||||
val user =
|
||||
User(
|
||||
id = UUID.randomUUID(),
|
||||
name = "Jane",
|
||||
email = "jane@mail.com",
|
||||
library = null,
|
||||
)
|
||||
|
||||
val entity = user.toEntity(AuthProvider.YANDEX, "yandex456")
|
||||
|
||||
@@ -48,12 +49,13 @@ class UserEntityMappingTest {
|
||||
|
||||
@Test
|
||||
fun `toEntity maps User without OAuth provider`() {
|
||||
val user = User(
|
||||
id = UUID.randomUUID(),
|
||||
name = "Bob",
|
||||
email = "bob@mail.com",
|
||||
library = null
|
||||
)
|
||||
val user =
|
||||
User(
|
||||
id = UUID.randomUUID(),
|
||||
name = "Bob",
|
||||
email = "bob@mail.com",
|
||||
library = null,
|
||||
)
|
||||
|
||||
val entity = user.toEntity()
|
||||
|
||||
@@ -63,12 +65,13 @@ class UserEntityMappingTest {
|
||||
|
||||
@Test
|
||||
fun `mapping is reversible for basic fields`() {
|
||||
val original = User(
|
||||
id = UUID.randomUUID(),
|
||||
name = "Alice",
|
||||
email = "alice@email.com",
|
||||
library = null
|
||||
)
|
||||
val original =
|
||||
User(
|
||||
id = UUID.randomUUID(),
|
||||
name = "Alice",
|
||||
email = "alice@email.com",
|
||||
library = null,
|
||||
)
|
||||
|
||||
val mapped = original.toEntity().toDomain()
|
||||
|
||||
@@ -76,6 +79,4 @@ class UserEntityMappingTest {
|
||||
assertEquals(original.name, mapped.name)
|
||||
assertEquals(original.email, mapped.email)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user