Skip to content

Commit

Permalink
generalized image to file
Browse files Browse the repository at this point in the history
  • Loading branch information
AvilaAndre committed Jul 20, 2024
1 parent dd4818b commit 1b664c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object ErrorMessages {

fun roleNotFound(id: Long): String = "role not found with id $id"

fun imageNotFound(imageName: String): String = "image not found with name $imageName"
fun fileNotFound(fileName: String): String = "file not found with name $fileName"

fun userAlreadyHasRole(roleId: Long, userId: Long): String = "user $userId already has role $roleId"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ abstract class AbstractActivityService<T : Activity>(
val imageRemoved = activity.gallery.remove(imageName)

if (!imageRemoved) {
throw NoSuchElementException(ErrorMessages.imageNotFound(imageName))
throw NoSuchElementException(ErrorMessages.fileNotFound(imageName))
}

return repository.save(activity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ internal class EventControllerTest @Autowired constructor(
status().isNotFound,
content().contentType(MediaType.APPLICATION_JSON),
jsonPath("$.errors.length()").value(1),
jsonPath("$.errors[0].message").value("image not found with name $wrongImageUrl")
jsonPath("$.errors[0].message").value("file not found with name $wrongImageUrl")
)
}
}
Expand Down

0 comments on commit 1b664c1

Please sign in to comment.