Skip to content

Commit

Permalink
rename CreateOrUpdateMissionWithActionsAndAttachedReporting
Browse files Browse the repository at this point in the history
  • Loading branch information
thoomasbro committed Jan 4, 2024
1 parent f407be7 commit 7c87f30
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -32,7 +32,7 @@ class Missions(
createMissionDataInput: CreateOrUpdateMissionDataInput,
): MissionDataOutput {
val createdMission =
createOrUpdateMissionWithAttachedReporting.execute(
createOrUpdateMissionWithActionsAndAttachedReporting.execute(
mission = createMissionDataInput.toMissionEntity(),
attachedReportingIds = createMissionDataInput.attachedReportingIds,
envActionsAttachedToReportingIds =
Expand Down Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import java.time.ZonedDateTime
import java.util.*

@ExtendWith(SpringExtension::class)
class CreateOrUpdateMissionWithAttachedReportingUTests {
class CreateOrUpdateMissionWithActionsAndAttachedReportingUTests {

@MockBean private lateinit var createOrUpdateMission: CreateOrUpdateMission

Expand Down Expand Up @@ -91,7 +91,7 @@ class CreateOrUpdateMissionWithAttachedReportingUTests {
given(reportingRepository.findById(3)).willReturn(getReportingDTO(3))
// When
val createdMissionDTO =
CreateOrUpdateMissionWithAttachedReporting(
CreateOrUpdateMissionWithActionsAndAttachedReporting(
createOrUpdateMission = createOrUpdateMission,
createOrUpdateEnvActions = createOrUpdateEnvActions,
missionRepository = missionRepository,
Expand Down Expand Up @@ -137,7 +137,7 @@ class CreateOrUpdateMissionWithAttachedReportingUTests {

// Then
assertThatThrownBy {
CreateOrUpdateMissionWithAttachedReporting(
CreateOrUpdateMissionWithActionsAndAttachedReporting(
createOrUpdateMission = createOrUpdateMission,
createOrUpdateEnvActions = createOrUpdateEnvActions,
missionRepository = missionRepository,
Expand Down Expand Up @@ -216,7 +216,7 @@ class CreateOrUpdateMissionWithAttachedReportingUTests {

// When
val createdMissionDTO =
CreateOrUpdateMissionWithAttachedReporting(
CreateOrUpdateMissionWithActionsAndAttachedReporting(
createOrUpdateMission = createOrUpdateMission,
createOrUpdateEnvActions = createOrUpdateEnvActions,
missionRepository = missionRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -118,7 +118,7 @@ class MissionsITests {
)
val requestbody = objectMapper.writeValueAsString(newMissionRequest)
given(
createOrUpdateMissionWithAttachedReporting.execute(
createOrUpdateMissionWithActionsAndAttachedReporting.execute(
mission = newMissionRequest.toMissionEntity(),
attachedReportingIds = listOf(),
envActionsAttachedToReportingIds = listOf(),
Expand Down Expand Up @@ -833,7 +833,7 @@ class MissionsITests {
) as
List<EnvActionAttachedToReportingIds>
given(
createOrUpdateMissionWithAttachedReporting.execute(
createOrUpdateMissionWithActionsAndAttachedReporting.execute(
mission = requestBody.toMissionEntity(),
attachedReportingIds = listOf(1),
envActionsAttachedToReportingIds = envActionsAttachedToReportingIds,
Expand Down

0 comments on commit 7c87f30

Please sign in to comment.