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

Delete permission by #98

Merged
merged 9 commits into from
Nov 12, 2024
Merged

Delete permission by #98

merged 9 commits into from
Nov 12, 2024

Conversation

PAP889
Copy link
Collaborator

@PAP889 PAP889 commented Nov 8, 2024

No description provided.

Copy link
Collaborator

@infa-rvarahag infa-rvarahag left a comment

Choose a reason for hiding this comment

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

Make sure , Suite should be like this .

  1. Method should be in a position to run individually
  2. as a complete suite it should be runnable from suite xml
  3. should be runnable from class level as well

private Response deletePermissionById(int createdId) {
try {
deletePermissionEndpoint = new URI(PROP_LIST.get("scp.delete.permission.endpoint").toString() + createdId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

use built in method get URI.
createrId should be passed in response avoid string concatenation

try {
// Construct the endpoint URI
listPermissionsByRoleEndpoint = new URI(PROP_LIST.get("scp.qa.listPermissionByRole.endpoint").toString());
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comments here, use built in method

response.prettyPrint();

// Validate response code is 200 for a successful deletion
Assert.assertEquals(statusCode, 202, "Status code should be 200 for successful deletion");
Copy link
Collaborator

Choose a reason for hiding this comment

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

message expecting 200 , but code looking for 202

logger.info("Started calling the GetListPermissionsByRole API with a valid role.");

// Call getListPermissionsByRole with a specific role
Response response = getListPermissionsByRole("admin"); // Replace "admin" with the actual role to test
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have role called "admin" ?
if hardcode like this, how it will run in prod .
Just see how we can achieve in all the environments

logger.info("Received expected error for invalid token.");
}
@Test(priority = 9 , description = "Verifies the functionality of deleting user's permission by ID.")
public void testDeletePermissionById() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you run this test method alone ?
this method should depend on testCreatePermissionWithValidPayload()
Check once .

Copy link
Collaborator

@infa-rvarahag infa-rvarahag left a comment

Choose a reason for hiding this comment

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

Next Submit, please make sure don't touch other code

@PAP889 PAP889 merged commit 2722195 into main Nov 12, 2024
@PAP889 PAP889 deleted the deletePermissionById branch November 12, 2024 10:19
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.

2 participants