use of com.redhat.service.smartevents.integration.tests.context.BridgeContext in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeSteps method bridgeIsExistingWithStatusWithinMinutes.
@And("^the Bridge \"([^\"]*)\" is existing with status \"([^\"]*)\" within (\\d+) (?:minute|minutes)$")
public void bridgeIsExistingWithStatusWithinMinutes(String testBridgeName, String status, int timeoutMinutes) {
BridgeContext bridgeContext = context.getBridge(testBridgeName);
Awaitility.await().conditionEvaluationListener(new AwaitilityOnTimeOutHandler(() -> BridgeResource.getBridgeDetailsResponse(context.getManagerToken(), bridgeContext.getId()).then().log().all())).atMost(Duration.ofMinutes(timeoutMinutes)).pollInterval(Duration.ofSeconds(5)).failFast(() -> BridgeResource.getBridgeDetailsResponse(context.getManagerToken(), bridgeContext.getId()).then().body("status", Matchers.not("failed"))).untilAsserted(() -> BridgeResource.getBridgeDetailsResponse(context.getManagerToken(), bridgeContext.getId()).then().body("status", Matchers.equalTo(status)).body("endpoint", Matchers.containsString(bridgeContext.getId())));
BridgeUtils.getOrRetrieveBridgeEventsEndpoint(context, testBridgeName);
}
use of com.redhat.service.smartevents.integration.tests.context.BridgeContext in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeSteps method createFakeBridge.
@When("^create a fake Bridge \"([^\"]*)\"$")
public void createFakeBridge(String testBridgeName) {
BridgeContext bridgeContext = context.newBridge(testBridgeName, Utils.generateId(testBridgeName), Utils.generateId("test-" + testBridgeName));
bridgeContext.setDeleted(true);
}
use of com.redhat.service.smartevents.integration.tests.context.BridgeContext in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeUtils method getOrRetrieveBridgeEventsEndpoint.
public static String getOrRetrieveBridgeEventsEndpoint(TestContext context, String testBridgeName) {
BridgeContext bridgeContext = context.getBridge(testBridgeName);
if (bridgeContext.getEndPoint() == null) {
// store bridge endpoint details
String endPoint = BridgeResource.getBridgeDetails(context.getManagerToken(), bridgeContext.getId()).getEndpoint();
// defined, otherwise rest-assured will use port 8080
if (endPoint.matches("http://localhost/.*")) {
endPoint = endPoint.replace("http://localhost/", "http://localhost:80/");
}
bridgeContext.setEndPoint(endPoint);
}
return bridgeContext.getEndPoint();
}
Aggregations