Skip to content

feat(testCucumberDeleteUser): add tests cucumber delete user#76

Merged
MayuriXx merged 4 commits into
mainfrom
feat/testCucumberDeleteUser
Apr 22, 2026
Merged

feat(testCucumberDeleteUser): add tests cucumber delete user#76
MayuriXx merged 4 commits into
mainfrom
feat/testCucumberDeleteUser

Conversation

@Theo-lbg
Copy link
Copy Markdown
Collaborator

This pull request adds integration test support for the DELETE user endpoint, enabling automated testing of user deletion scenarios. The changes include new step definitions, test utility methods, and a feature file with scenarios for deleting users.

Integration test support for DELETE user endpoint:

  • Added a new feature file delete_user.feature covering scenarios for deleting a user by ID, including both successful deletion and deletion of a non-existent user.
  • Implemented new step definitions in StepDefinition.java to handle DELETE requests for specific users and the most recently created user.
  • Added an executeDelete helper method to SpringIntegrationTest.java to facilitate sending DELETE HTTP requests in tests.
  • Imported HttpMethod to support the new DELETE request method.

@sonarqube-xpeho
Copy link
Copy Markdown

@Theo-lbg Theo-lbg marked this pull request as ready for review April 21, 2026 10:32
Copilot AI review requested due to automatic review settings April 21, 2026 10:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Cucumber-based integration test coverage for the DELETE /random-users/{id} endpoint within the existing Cucumber test suite (src/test/java/feature + src/test/resources/features).

Changes:

  • Introduces delete_user.feature with scenarios for deleting an existing user and attempting to delete a non-existent user.
  • Adds new Cucumber step definitions to issue DELETE requests (by explicit ID or by previously created ID).
  • Extends the shared integration test base with an executeDelete(...) helper using TestRestTemplate.exchange.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/test/resources/features/delete_user.feature Adds new DELETE endpoint scenarios and status code assertions.
src/test/java/feature/StepDefinition.java Adds @When steps to call DELETE endpoints (including deleting the created user).
src/test/java/feature/SpringIntegrationTest.java Adds executeDelete helper and imports HttpMethod.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/resources/features/delete_user.feature
Comment thread src/test/resources/features/delete_user.feature
@MayuriXx MayuriXx merged commit 65800bf into main Apr 22, 2026
10 checks passed
@MayuriXx MayuriXx deleted the feat/testCucumberDeleteUser branch April 22, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants