use of com.redhat.service.smartevents.integration.tests.common.AwaitilityOnTimeOutHandler in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorSteps method processorOfBridgeIsExistingWithStatusWithinMinutes.
@Then("^the Processor \"([^\"]*)\" of the Bridge \"([^\"]*)\" is existing with status \"([^\"]*)\" within (\\d+) (?:minute|minutes)$")
public void processorOfBridgeIsExistingWithStatusWithinMinutes(String processorName, String testBridgeName, String status, int timeoutMinutes) {
BridgeContext bridgeContext = context.getBridge(testBridgeName);
String processorId = bridgeContext.getProcessor(processorName).getId();
Awaitility.await().conditionEvaluationListener(new AwaitilityOnTimeOutHandler(() -> ProcessorResource.getProcessorResponse(context.getManagerToken(), bridgeContext.getId(), processorId).then().log().all())).atMost(Duration.ofMinutes(timeoutMinutes)).pollInterval(Duration.ofSeconds(5)).failFast(() -> ProcessorResource.getProcessorResponse(context.getManagerToken(), bridgeContext.getId(), processorId).then().body("status", Matchers.not("failed"))).untilAsserted(() -> ProcessorResource.getProcessorResponse(context.getManagerToken(), bridgeContext.getId(), processorId).then().body("status", Matchers.equalTo(status)));
}
use of com.redhat.service.smartevents.integration.tests.common.AwaitilityOnTimeOutHandler in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorSteps method processorOfBridgeIsNotExistingWithinMinutes.
@Then("^the Processor \"([^\"]*)\" of the Bridge \"([^\"]*)\" is not existing within (\\d+) (?:minute|minutes)$")
public void processorOfBridgeIsNotExistingWithinMinutes(String processorName, String testBridgeName, int timeoutMinutes) {
BridgeContext bridgeContext = context.getBridge(testBridgeName);
String processorId = bridgeContext.getProcessor(processorName).getId();
Awaitility.await().conditionEvaluationListener(new AwaitilityOnTimeOutHandler(() -> ProcessorResource.getProcessorResponse(context.getManagerToken(), bridgeContext.getId(), processorId).then().log().all())).atMost(Duration.ofMinutes(timeoutMinutes)).pollInterval(Duration.ofSeconds(5)).untilAsserted(() -> ProcessorResource.getProcessorResponse(context.getManagerToken(), bridgeContext.getId(), processorId).then().statusCode(404));
}
use of com.redhat.service.smartevents.integration.tests.common.AwaitilityOnTimeOutHandler in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeSteps method bridgeIsNotExistingWithinMinutes.
@Then("^the Bridge \"([^\"]*)\" is not existing within (\\d+) (?:minute|minutes)$")
public void bridgeIsNotExistingWithinMinutes(String testBridgeName, 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)).untilAsserted(() -> BridgeResource.getBridgeDetailsResponse(context.getManagerToken(), bridgeContext.getId()).then().statusCode(404));
}
use of com.redhat.service.smartevents.integration.tests.common.AwaitilityOnTimeOutHandler 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);
}
Aggregations