-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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.
Make sure , Suite should be like this .
- Method should be in a position to run individually
- as a complete suite it should be runnable from suite xml
- 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); |
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.
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()); |
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.
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"); |
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.
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 |
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.
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() { |
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.
can you run this test method alone ?
this method should depend on testCreatePermissionWithValidPayload()
Check once .
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.
Next Submit, please make sure don't touch other code
No description provided.