-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GetPrioNotificationTypes use case unit test in Backend
- Loading branch information
1 parent
9e35543
commit 17dbe5f
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../gouv/cnsp/monitorfish/domain/use_cases/prior_notification/GetPriorNotificationsUTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.use_cases.prior_notification | ||
|
||
import com.nhaarman.mockitokotlin2.given | ||
import fr.gouv.cnsp.monitorfish.domain.repositories.* | ||
import org.assertj.core.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.ExtendWith | ||
import org.springframework.boot.test.mock.mockito.MockBean | ||
import org.springframework.test.context.junit.jupiter.SpringExtension | ||
|
||
@ExtendWith(SpringExtension::class) | ||
class GetPriorNotificationsUTests { | ||
@MockBean | ||
private lateinit var logbookReportRepository: LogbookReportRepository | ||
|
||
@Test | ||
fun `execute Should return a list of prior notifications`() { | ||
// Given | ||
given(logbookReportRepository.findDistinctPriorNotificationTypes()).willReturn( | ||
listOf("Préavis de Type A", "Préavis de Type B"), | ||
) | ||
|
||
// When | ||
val result = GetPriorNotificationTypes(logbookReportRepository).execute() | ||
|
||
// Then | ||
Assertions.assertThat(result).isEqualTo(listOf("Préavis de Type A", "Préavis de Type B")) | ||
} | ||
} |