Skip to content

Commit

Permalink
fix: Added explanation to line and replaced variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AvilaAndre committed Nov 6, 2024
1 parent c796bac commit 0b5c228
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CloudinaryFileUploader(private val basePath: String, private val cloudinar
}

override fun deleteImage(fileName: String) {
// Here, fileName is the publicId in Cloudinary, which would be the path to the file
cloudinary.uploader().destroy(
fileName,
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,17 +863,17 @@ internal class EventControllerTest @Autowired constructor(

@Test
fun `should fail if event does not exist`() {
val unexistentID = 5
val nonexistentID = 5

mockMvc.multipartBuilder("/events/$unexistentID/gallery")
mockMvc.multipartBuilder("/events/$nonexistentID/gallery")
.asPutMethod()
.addFile("image", contentType = MediaType.IMAGE_JPEG_VALUE)
.perform()
.andExpectAll(
status().isNotFound,
content().contentType(MediaType.APPLICATION_JSON),
jsonPath("$.errors.length()").value(1),
jsonPath("$.errors[0].message").value("activity not found with id $unexistentID")
jsonPath("$.errors[0].message").value("activity not found with id $nonexistentID")
)
}

Expand Down Expand Up @@ -945,17 +945,17 @@ internal class EventControllerTest @Autowired constructor(

@Test
fun `should fail if event does not exist`() {
val unexistentID = 5
val nonexistentID = 5

mockMvc.multipartBuilder("/events/$unexistentID/gallery")
mockMvc.multipartBuilder("/events/$nonexistentID/gallery")
.asDeleteMethod()
.addPart("imageUrl", mockImageUrl)
.perform()
.andExpectAll(
status().isNotFound,
content().contentType(MediaType.APPLICATION_JSON),
jsonPath("$.errors.length()").value(1),
jsonPath("$.errors[0].message").value("activity not found with id $unexistentID")
jsonPath("$.errors[0].message").value("activity not found with id $nonexistentID")
)
}

Expand Down

0 comments on commit 0b5c228

Please sign in to comment.