-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for exeptions ignored by Bugsnag
- Loading branch information
Tobias Mende
committed
Jul 21, 2021
1 parent
cc9a548
commit 2ac8f75
Showing
5 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
bugsnag-spring/src/test/java/com/bugsnag/testapp/springboot/TestCustomException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.bugsnag.testapp.springboot; | ||
|
||
public class TestCustomException extends RuntimeException { | ||
} |
13 changes: 13 additions & 0 deletions
13
bugsnag-spring/src/test/java/com/bugsnag/testapp/springboot/TestExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.bugsnag.testapp.springboot; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ControllerAdvice; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
|
||
@ControllerAdvice | ||
public class TestExceptionHandler { | ||
@ExceptionHandler(TestCustomException.class) | ||
public ResponseEntity handleTestCustomException(TestCustomException ignored) { | ||
return ResponseEntity.ok(TestCustomException.class.getSimpleName()); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
bugsnag-spring/src/test/java/com/bugsnag/testapp/springboot/TestResponseStatusException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.bugsnag.testapp.springboot; | ||
|
||
import static org.springframework.http.HttpStatus.I_AM_A_TEAPOT; | ||
|
||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
|
||
@ResponseStatus(I_AM_A_TEAPOT) | ||
public class TestResponseStatusException extends RuntimeException { | ||
} |