Skip to content

Commit 828c0f4

Browse files
committed
test: build task email test data through TaskTestData
1 parent 21379e3 commit 828c0f4

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

backend/data/src/test/kotlin/io/tolgee/unit/TaskEmailComposerTest.kt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package io.tolgee.unit
22

33
import io.tolgee.component.FrontendUrlProvider
4-
import io.tolgee.model.Language
4+
import io.tolgee.development.testDataBuilder.data.TaskTestData
55
import io.tolgee.model.notifications.Notification
6-
import io.tolgee.model.notifications.NotificationType
7-
import io.tolgee.model.task.Task
86
import io.tolgee.service.notification.TaskEmailComposer
97
import io.tolgee.testing.assert
108
import io.tolgee.util.I18n
@@ -40,16 +38,12 @@ class TaskEmailComposerTest {
4038
taskName: String = "Translate",
4139
languageName: String = "English",
4240
): Notification {
43-
val task =
44-
Task().apply {
45-
this.name = taskName
46-
this.number = 1L
47-
this.language = Language().apply { this.name = languageName }
48-
}
49-
50-
return Notification().apply {
51-
this.type = NotificationType.TASK_ASSIGNED
52-
this.linkedTask = task
41+
val testData = TaskTestData()
42+
testData.addNotifications()
43+
testData.translateTask.self.apply {
44+
name = taskName
45+
language.name = languageName
5346
}
47+
return testData.taskNotification.self
5448
}
5549
}

0 commit comments

Comments
 (0)