You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API [Rate event] Status code 400 and incorrect error message is shown in the response instead of 403 when the organizer tries to rate his own event
#7827
Closed
Yuliia85 opened this issue
Nov 26, 2024
· 0 comments
· Fixed by #7855
Yuliia85
changed the title
API [Create event] Status code 400 and incorrect error message is shown in the response instead of 403 when the organizer tries to rate his own event
API [Rate event] Status code 400 and incorrect error message is shown in the response instead of 403 when the organizer tries to rate his own event
Nov 27, 2024
…e own event. (#7855)
* Added restriction to rate own event in method rateEvent() in EventServiceImpl;
Replaced restTemplate to userRepo for finding userByEmail in rateEvent() method in EventServiceImpl;
Added error message constant 'Organizer has no rights to rate the own event' into ErrorMessages class;
Created missed unit tests for rateEvent() method for EventServiceImpl class;
Added method getEventNotStartedYet() for creating not started event yet into ModelUtils class;
* Fixed code formatting according to formatter-maven-plugin cause build faided by CI/CD;
* Refactored unit tests for rateEvent() method in EventServiceImplTests according to sonar issues;
* Additional refactoring according to sonar issue documentation;
* Removed underscores from test method names in EventServiceImplTest;
* Replaced wildcard import to separated;
* Added word 'Test' to names for each test in EventServiceImplTest;
Environment: OS: Windows 10 Pro, Browser Chrome version 130.6723.92
Reproducible: always
Build found: bafb13d
Preconditions
Steps to reproduce
Actual result
Status code 400 and incorrect error message is shown in the response instead of 403 when the organizer tries to rate his own event
Expected result
Status code 403 (Forbidden) and error message " Organizer have no rights to rate the own event" is shown after sending the request
User story and test case links
E.g.: "User story #3193
Labels to be added
"Bug", Priority ("pri: "), Severity ("severity:"), Type ("UI, "Functional"), "API" (for back-end bugs).
The text was updated successfully, but these errors were encountered: