Skip to content

Commit

Permalink
Update and rename GetEnvMissionByIdTest.kt to GetEnvMissionById2Test.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
xtiannyeto authored Jan 9, 2025
1 parent 5dff9a6 commit cbd49e2
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fr.gouv.dgampa.rapportnav.domain.entities.mission.env.MissionEntity
import fr.gouv.dgampa.rapportnav.domain.entities.mission.env.MissionSourceEnum
import fr.gouv.dgampa.rapportnav.domain.entities.mission.env.MissionTypeEnum
import fr.gouv.dgampa.rapportnav.domain.repositories.mission.IEnvMissionRepository
import fr.gouv.dgampa.rapportnav.domain.use_cases.mission.action.v2.GetEnvMissionById
import fr.gouv.dgampa.rapportnav.domain.use_cases.mission.action.v2.GetEnvMissionById2
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
import org.mockito.Mockito.*
Expand All @@ -13,11 +13,11 @@ import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.mock.mockito.MockBean
import java.time.Instant

@SpringBootTest(classes = [GetEnvMissionById::class])
class GetEnvMissionByIdTest {
@SpringBootTest(classes = [GetEnvMissionById2::class])
class GetEnvMissionById2Test {

@Autowired
private lateinit var getEnvMissionById: GetEnvMissionById
private lateinit var getEnvMissionById2: GetEnvMissionById2

@MockBean
private lateinit var monitorEnvApiRepo: IEnvMissionRepository
Expand All @@ -40,10 +40,10 @@ class GetEnvMissionByIdTest {
// Mock behavior of findMissionById to return a MissionEntity
`when`(monitorEnvApiRepo.findMissionById(missionId)).thenReturn(missionEntity)

getEnvMissionById = GetEnvMissionById(monitorEnvApiRepo)
getEnvMissionById2 = GetEnvMissionById2(monitorEnvApiRepo)

// When
val result = getEnvMissionById.execute(missionId)
val result = getEnvMissionById2.execute(missionId)

// Then
assertNotNull(result)
Expand Down

0 comments on commit cbd49e2

Please sign in to comment.