Skip to content

Commit

Permalink
Backend - fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thoomasbro committed May 5, 2022
1 parent da09f5a commit f342aa1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ class CreateMission(private val missionRepository: IMissionRepository) {
"No mission to update"
}
val newMission = missionRepository.save(mission)
if (newMission.id === null) {
throw (IllegalArgumentException("MissionId is missing. Mission was not created"))
}
return missionRepository.findMissionById(newMission.id)
return missionRepository.findMissionById(newMission.id)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ class UpdateMission(private val missionRepository: IMissionRepository) {
"No mission to update"
}
missionRepository.save(mission)
if (mission.id === null) {
throw (IllegalArgumentException("MissionId is missing. Mission was not created"))
}
return missionRepository.findMissionById(mission.id)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ class JpaMissionRepositoryITests : AbstractDBTests() {
// When
val firstMission = MissionEntity(
id = 10,
missionType= MissionTypeEnum.SEA,
missionType = MissionTypeEnum.SEA,
unit = "Aff Mar 01",
administration = "ULAM",
missionStatus = "OPEN",
facade = "MED",
theme = "CONTROLE",
observations = "Offer watch bank activity. During response letter. Indeed allow bill animal.",
inputStartDatetimeUtc = ZonedDateTime.parse("2022-03-05T01:34:39Z"),
inputEndDatetimeUtc = ZonedDateTime.parse("2022-04-26T22:11:17Z"),
author = "Evan Castro",
facade = "MEMN",
theme = "ENV",
observations = "Air data now. Husband prove born rise his everything order. Range memory control room evidence firm adult.",
inputStartDatetimeUtc = ZonedDateTime.parse("2022-01-20T07:41:28Z"),
inputEndDatetimeUtc = ZonedDateTime.parse("2022-02-11T11:18:25Z"),
actions = listOf()
)
val mission = jpaMissionRepository.findMissionById(10)
Expand Down

0 comments on commit f342aa1

Please sign in to comment.