Skip to content

Commit

Permalink
Remove unnecessary condition from Salesforce testAccountWithBasicInfo…
Browse files Browse the repository at this point in the history
… test
  • Loading branch information
zbendhiba authored and ppalaga committed Aug 9, 2021
1 parent fee5e52 commit 14daf3c
Showing 1 changed file with 27 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,35 +156,33 @@ void testAccountWithBasicInfo() {
.body()
.asString();

if (accountId != null) {
// get Account basic info
SObjectBasicInfo accountBasicInfo = RestAssured.given()
.get("/salesforce/basic-info/account")
.then()
.statusCode(200)
.extract()
.body()
.as(SObjectBasicInfo.class);
assertNotNull(accountBasicInfo);
List<RecentItem> recentItems = accountBasicInfo.getRecentItems();
assertNotNull(recentItems);
// make sure the created account is referenced
assertTrue(recentItems.stream().anyMatch(recentItem -> recentItem.getAttributes().getUrl().contains(accountId)));

// Get Account - querying Sobject by ID
RestAssured.get("/salesforce/account/" + accountId)
.then()
.statusCode(200)
.body(
"Id", not(emptyString()),
"AccountNumber", not(emptyString()));

// delete the account
// Clean up
RestAssured.delete("/salesforce/account/" + accountId)
.then()
.statusCode(204);
}
// get Account basic info
SObjectBasicInfo accountBasicInfo = RestAssured.given()
.get("/salesforce/basic-info/account")
.then()
.statusCode(200)
.extract()
.body()
.as(SObjectBasicInfo.class);
assertNotNull(accountBasicInfo);
List<RecentItem> recentItems = accountBasicInfo.getRecentItems();
assertNotNull(recentItems);
// make sure the created account is referenced
assertTrue(recentItems.stream().anyMatch(recentItem -> recentItem.getAttributes().getUrl().contains(accountId)));

// Get Account - querying Sobject by ID
RestAssured.get("/salesforce/account/" + accountId)
.then()
.statusCode(200)
.body(
"Id", not(emptyString()),
"AccountNumber", not(emptyString()));

// delete the account
// Clean up
RestAssured.delete("/salesforce/account/" + accountId)
.then()
.statusCode(204);
}

@Test
Expand Down

0 comments on commit 14daf3c

Please sign in to comment.