Skip to content

Commit

Permalink
[feature/MNT-24127-EndpointToCalculateFolderSize] Addressing review c…
Browse files Browse the repository at this point in the history
…omments
  • Loading branch information
mohit-singh4 committed Oct 19, 2024
1 parent d49d4c2 commit 7f95d62
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,17 @@ public void testPostAndGetFolderSizeDetails() throws Exception
assertNotNull("After executing POST/size-details first time, it will provide jobId with 202 status code",
postResponse.getJsonResponse());

JSONObject jsonObject = (JSONObject) postResponse.getJsonResponse()
.get("entry");
NodeSizeDetails nodeSizeDetails = RestApiUtil.parseRestApiEntry(postResponse.getJsonResponse(), NodeSizeDetails.class);

String jobId = (String) jsonObject.get("jobId");
String jobId = nodeSizeDetails.getJobId();
assertNotNull("In response, JobId should be present", jobId);

HttpResponse getResponse = getSingle(getNodeSizeDetailsUrl(childFolder, jobId), null, 200);

assertNotNull("After executing GET/size-details, it will provide NodeSizeDetails with 200 status code",
getResponse.getJsonResponse());

NodeSizeDetails nodeSizeDetails = parseNodeSizeDetails(
(JSONObject) getResponse.getJsonResponse()
.get("entry"));
nodeSizeDetails = RestApiUtil.parseRestApiEntry(postResponse.getJsonResponse(), NodeSizeDetails.class);

assertNotNull("We are not getting correct response " + nodeSizeDetails, nodeSizeDetails.getStatus());
assertEquals("SizeDetails hasn't been calculated yet, current status -" + nodeSizeDetails.getStatus().name() + "]", status, nodeSizeDetails.getStatus().name());
Expand Down

0 comments on commit 7f95d62

Please sign in to comment.