diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithAttachedReporting.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithActionsAndAttachedReporting.kt similarity index 95% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithAttachedReporting.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithActionsAndAttachedReporting.kt index 63fbc18139..f73f4af83f 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithAttachedReporting.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithActionsAndAttachedReporting.kt @@ -13,14 +13,14 @@ import org.slf4j.LoggerFactory import java.util.UUID @UseCase -class CreateOrUpdateMissionWithAttachedReporting( +class CreateOrUpdateMissionWithActionsAndAttachedReporting( private val createOrUpdateMission: CreateOrUpdateMission, private val createOrUpdateEnvActions: CreateOrUpdateEnvActions, private val missionRepository: IMissionRepository, private val reportingRepository: IReportingRepository, ) { private val logger = - LoggerFactory.getLogger(CreateOrUpdateMissionWithAttachedReporting::class.java) + LoggerFactory.getLogger(CreateOrUpdateMissionWithActionsAndAttachedReporting::class.java) @Throws(IllegalArgumentException::class) fun execute( diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/v1/Missions.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/v1/Missions.kt index 6bacb13270..3958111c03 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/v1/Missions.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/v1/Missions.kt @@ -18,8 +18,8 @@ import java.time.ZonedDateTime @RequestMapping("/bff/v1/missions") @Tag(description = "API Missions", name = "BFF.Missions") class Missions( - private val createOrUpdateMissionWithAttachedReporting: - CreateOrUpdateMissionWithAttachedReporting, + private val createOrUpdateMissionWithActionsAndAttachedReporting: + CreateOrUpdateMissionWithActionsAndAttachedReporting, private val getFullMissions: GetFullMissions, private val getFullMissionById: GetFullMissionById, private val deleteMission: DeleteMission, @@ -32,7 +32,7 @@ class Missions( createMissionDataInput: CreateOrUpdateMissionDataInput, ): MissionDataOutput { val createdMission = - createOrUpdateMissionWithAttachedReporting.execute( + createOrUpdateMissionWithActionsAndAttachedReporting.execute( mission = createMissionDataInput.toMissionEntity(), attachedReportingIds = createMissionDataInput.attachedReportingIds, envActionsAttachedToReportingIds = @@ -128,7 +128,7 @@ class Missions( if ((updateMissionDataInput.id != null) && (missionId != updateMissionDataInput.id)) { throw java.lang.IllegalArgumentException("missionId doesn't match with request param") } - return createOrUpdateMissionWithAttachedReporting.execute( + return createOrUpdateMissionWithActionsAndAttachedReporting.execute( mission = updateMissionDataInput.toMissionEntity(), attachedReportingIds = updateMissionDataInput.attachedReportingIds, envActionsAttachedToReportingIds = diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithAttachedReportingUTests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithActionsAndAttachedReportingUTests.kt similarity index 97% rename from backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithAttachedReportingUTests.kt rename to backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithActionsAndAttachedReportingUTests.kt index b0fe5ad601..ee040bf98b 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithAttachedReportingUTests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/missions/CreateOrUpdateMissionWithActionsAndAttachedReportingUTests.kt @@ -26,7 +26,7 @@ import java.time.ZonedDateTime import java.util.* @ExtendWith(SpringExtension::class) -class CreateOrUpdateMissionWithAttachedReportingUTests { +class CreateOrUpdateMissionWithActionsAndAttachedReportingUTests { @MockBean private lateinit var createOrUpdateMission: CreateOrUpdateMission @@ -91,7 +91,7 @@ class CreateOrUpdateMissionWithAttachedReportingUTests { given(reportingRepository.findById(3)).willReturn(getReportingDTO(3)) // When val createdMissionDTO = - CreateOrUpdateMissionWithAttachedReporting( + CreateOrUpdateMissionWithActionsAndAttachedReporting( createOrUpdateMission = createOrUpdateMission, createOrUpdateEnvActions = createOrUpdateEnvActions, missionRepository = missionRepository, @@ -137,7 +137,7 @@ class CreateOrUpdateMissionWithAttachedReportingUTests { // Then assertThatThrownBy { - CreateOrUpdateMissionWithAttachedReporting( + CreateOrUpdateMissionWithActionsAndAttachedReporting( createOrUpdateMission = createOrUpdateMission, createOrUpdateEnvActions = createOrUpdateEnvActions, missionRepository = missionRepository, @@ -216,7 +216,7 @@ class CreateOrUpdateMissionWithAttachedReportingUTests { // When val createdMissionDTO = - CreateOrUpdateMissionWithAttachedReporting( + CreateOrUpdateMissionWithActionsAndAttachedReporting( createOrUpdateMission = createOrUpdateMission, createOrUpdateEnvActions = createOrUpdateEnvActions, missionRepository = missionRepository, diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsITests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsITests.kt index 29fd60dd29..0edad4a095 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsITests.kt @@ -55,8 +55,8 @@ class MissionsITests { @Autowired private lateinit var mockMvc: MockMvc @MockBean - private lateinit var createOrUpdateMissionWithAttachedReporting: - CreateOrUpdateMissionWithAttachedReporting + private lateinit var createOrUpdateMissionWithActionsAndAttachedReporting: + CreateOrUpdateMissionWithActionsAndAttachedReporting @MockBean private lateinit var getFullMissions: GetFullMissions @@ -118,7 +118,7 @@ class MissionsITests { ) val requestbody = objectMapper.writeValueAsString(newMissionRequest) given( - createOrUpdateMissionWithAttachedReporting.execute( + createOrUpdateMissionWithActionsAndAttachedReporting.execute( mission = newMissionRequest.toMissionEntity(), attachedReportingIds = listOf(), envActionsAttachedToReportingIds = listOf(), @@ -833,7 +833,7 @@ class MissionsITests { ) as List given( - createOrUpdateMissionWithAttachedReporting.execute( + createOrUpdateMissionWithActionsAndAttachedReporting.execute( mission = requestBody.toMissionEntity(), attachedReportingIds = listOf(1), envActionsAttachedToReportingIds = envActionsAttachedToReportingIds,