Skip to content

Commit

Permalink
switched handleAll status code
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonJales committed Jan 18, 2024
1 parent e001a44 commit 798661f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
public ResponseEntity<ExceptionResponse> handleAll(Exception ex) {
ExceptionResponse response = new ExceptionResponse(
LocalDateTime.now(),
HttpStatus.BAD_REQUEST,
HttpStatus.INTERNAL_SERVER_ERROR,
ex.getMessage());

response.getErrors().add(ex.getLocalizedMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public void hanleAllTest() {
Assert.assertNotNull(responseEntity);
Assert.assertNotNull(responseEntity.getBody());
Assert.assertEquals(ResponseEntity.class, responseEntity.getClass());
Assert.assertEquals(HttpStatus.BAD_REQUEST.value(), responseEntity.getBody().getStatus().value());
Assert.assertEquals(HttpStatus.BAD_REQUEST, responseEntity.getStatusCode());
Assert.assertEquals(HttpStatus.INTERNAL_SERVER_ERROR.value(), responseEntity.getBody().getStatus().value());
Assert.assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
Assert.assertEquals(errorMsg, responseEntity.getBody().getErrors().get(0));
}

Expand Down

0 comments on commit 798661f

Please sign in to comment.