Skip to content

Commit

Permalink
fix: do not archive limitless vigilance areas
Browse files Browse the repository at this point in the history
  • Loading branch information
maximeperrault authored and maximeperraultdev committed Jan 20, 2025
1 parent 51cf6d2 commit 8a72917
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import fr.gouv.cacem.monitorenv.domain.entities.vigilanceArea.FrequencyEnum
import fr.gouv.cacem.monitorenv.domain.entities.vigilanceArea.ImageEntity
import fr.gouv.cacem.monitorenv.domain.entities.vigilanceArea.VigilanceAreaEntity
import fr.gouv.cacem.monitorenv.domain.entities.vigilanceArea.VisibilityEnum
import fr.gouv.cacem.monitorenv.domain.use_cases.vigilanceArea.fixtures.VigilanceAreaFixture
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -192,6 +193,20 @@ class JpaVigilanceAreaRepositoryITests : AbstractDBTests() {
assertThat(archivedVigilanceArea?.isArchived).isEqualTo(true)
}

@Test
@Transactional
fun `archive should not archive limitless vigilance areas`() {
// Given
val limitlessVigilanceArea =
VigilanceAreaFixture.aVigilanceAreaEntity().copy(id = null, isAtAllTimes = true)
val savedVigilanceArea = jpaVigilanceAreaRepository.save(limitlessVigilanceArea)
// When
jpaVigilanceAreaRepository.archiveOutdatedVigilanceAreas()
// Then
val archivedVigilanceArea = jpaVigilanceAreaRepository.findById(savedVigilanceArea.id!!)
assertThat(archivedVigilanceArea?.isArchived).isEqualTo(false)
}

@Test
fun `findAllByGeometry should return all vigilance areas that intersect the geometry `() {
// Given
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8a72917

Please sign in to comment.