Skip to content

Commit

Permalink
checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
apurbraj committed Jun 3, 2024
1 parent 039fc3a commit 3659a03
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,32 +102,28 @@ public void mojaloopSetup() throws JsonProcessingException {
mojaloopDef.oracleOnboard();
}
}

@Before("@ConditionalSkip")
public void beforeScenario(Scenario scenario) {
boolean shouldSkip = checkCondition();
if (!shouldSkip) {
Assume.assumeTrue("Skipping scenario: " + scenario.getName(), false);
}
}

private boolean checkCondition() {
RequestSpecification requestSpec = Utils.getDefaultSpec();
String endpoint = mojaloopConfig.mojaloopHubAccount;

String mojaloopBaseUrl = mojaloopConfig.mojaloopBaseurl;

try {
int statusCode = RestAssured.given(requestSpec)
.baseUri(mojaloopBaseUrl)
.when()
.get("/actuator")
.then()
.extract()
.statusCode();
int statusCode = RestAssured.given(requestSpec).baseUri(mojaloopBaseUrl).when().get("/actuator").then().extract().statusCode();

return statusCode == 200;
} catch (Exception e) {

e.printStackTrace();
logger.error(e.getMessage());
return false;
}

Expand Down

0 comments on commit 3659a03

Please sign in to comment.