-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
10 - enhancing the controller advice class #20
Conversation
- added different exception handler methods to handle BadRequestException,ErrorSavingEntityToDatabaseException, ResourceNotFoundException
@ohbus can i add new unit test class to verify the exception handler capability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use the @ControllerAdvice
annotation or the @RestControllerAdvice
This was already implemented to check some functionalities, which will be removed in the final version.
Also, remember to add Unit tests for your code.
- added controller tests to assert and verify the exceptions handles from exception handler - added the embedded h2 autoconfigure setup for jpa
@ohbus please check the unit tests added to the change |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the Static Errors reported by Codacy.
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add the JUnit dependency as it is already there.
Please use Junit5/Jupiter engine for writing the test cases.
Overview
Connects FEATURE: Enable Global Exception #10
Notes