Skip to content
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

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
Assignees
Labels
Milestone

Comments

@Yuliia85
Copy link

Yuliia85 commented Nov 26, 2024

Environment: OS: Windows 10 Pro, Browser Chrome version 130.6723.92
Reproducible: always
Build found: bafb13d

Preconditions

  1. The event created by the user previously
  2. The event has already passed
  3. The user is logged in, and the token is gotten.

Steps to reproduce

  1. Enter into the URL field https://greencity.greencity.cx.ua/events/{eventId}/ratings
  2. Select the POST method from dropdown list
  3. In the request body tab select row checkbox
  4. Enter any stars count from 1 to 3 in the request body
  5. Click send button
  6. Pay attention to the status code and error message in the response

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

organizer

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).

@Yuliia85 Yuliia85 self-assigned this Nov 26, 2024
@github-project-automation github-project-automation bot moved this to Sprint Backlog in GreenCity Nov 26, 2024
@Yuliia85 Yuliia85 moved this from Sprint Backlog to Bugs in GreenCity Nov 26, 2024
@Yuliia85 Yuliia85 removed their assignment Nov 26, 2024
@Yuliia85 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
@ChernenkoVitaliy ChernenkoVitaliy self-assigned this Dec 2, 2024
@ChernenkoVitaliy ChernenkoVitaliy moved this from To Do to In Progress in Java GreenCity Sprint Dec 2, 2024
@ChernenkoVitaliy ChernenkoVitaliy added this to the UI S52.1 milestone Dec 2, 2024
@ChernenkoVitaliy ChernenkoVitaliy moved this from Bugs to Bugs in progress in GreenCity Dec 2, 2024
@ChernenkoVitaliy ChernenkoVitaliy moved this from In Progress to On Review in Java GreenCity Sprint Dec 2, 2024
ChernenkoVitaliy added a commit that referenced this issue Dec 3, 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;
@softservedata softservedata modified the milestones: UI S52.1, Java S52.1 Dec 3, 2024
@ChernenkoVitaliy ChernenkoVitaliy moved this from On Review to Done in Java GreenCity Sprint Dec 3, 2024
@ChernenkoVitaliy ChernenkoVitaliy moved this from Bugs in progress to Bugs Retesting in GreenCity Dec 3, 2024
@softservedata softservedata added the back-end This is label if this task is back-end label Dec 6, 2024
@Yuliia85 Yuliia85 moved this from Bugs Retesting to Testing in Progress in GreenCity Dec 8, 2024
@Yuliia85 Yuliia85 moved this from Testing in Progress to Done in GreenCity Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
3 participants