Skip to content

Commit

Permalink
[P4ADEV-1828] fixed http status
Browse files Browse the repository at this point in the history
  • Loading branch information
mscarsel committed Jan 13, 2025
1 parent e3d8f7b commit 9b119d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class FileshareExceptionHandler {

@ExceptionHandler({InvalidFileException.class})
public ResponseEntity<FileshareErrorDTO> handleInvalidFileError(RuntimeException ex, HttpServletRequest request){
return handleFileshareErrorException(ex, request, HttpStatus.INTERNAL_SERVER_ERROR, CodeEnum.INVALID_FILE);
return handleFileshareErrorException(ex, request, HttpStatus.BAD_REQUEST, CodeEnum.INVALID_FILE);
}

static ResponseEntity<FileshareErrorDTO> handleFileshareErrorException(RuntimeException ex, HttpServletRequest request, HttpStatus httpStatus, FileshareErrorDTO.CodeEnum errorEnum) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void handleInvalidFileException() throws Exception {
.param(DATA, DATA)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andExpect(MockMvcResultMatchers.status().isInternalServerError())
.andExpect(MockMvcResultMatchers.status().isBadRequest())
.andExpect(MockMvcResultMatchers.jsonPath("$.code").value(CodeEnum.INVALID_FILE.toString()))
.andExpect(MockMvcResultMatchers.jsonPath("$.message").value("Error"));
}
Expand Down

0 comments on commit 9b119d8

Please sign in to comment.