use of com.redhat.service.bridge.integration.tests.context.BridgeContext 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().atMost(Duration.ofMinutes(timeoutMinutes)).pollInterval(Duration.ofSeconds(5)).untilAsserted(() -> BridgeResource.getBridgeDetailsResponse(context.getManagerToken(), bridgeContext.getId()).then().statusCode(404));
}
use of com.redhat.service.bridge.integration.tests.context.BridgeContext in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeSteps method listOfBridgeInstancesIsContainingBridge.
@And("^the list of Bridge instances is containing the Bridge \"([^\"]*)\"$")
public void listOfBridgeInstancesIsContainingBridge(String testBridgeName) {
BridgeContext bridgeContext = context.getBridge(testBridgeName);
BridgeListResponse response = BridgeResource.getBridgeList(context.getManagerToken());
assertThat(response.getItems()).anyMatch(b -> b.getId().equals(bridgeContext.getId()));
BridgeResponse bridge = response.getItems().stream().filter(b -> b.getId().equals(bridgeContext.getId())).findFirst().orElseThrow();
assertThat(bridge.getName()).isEqualTo(bridgeContext.getName());
}
use of com.redhat.service.bridge.integration.tests.context.BridgeContext in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeSteps method addFakeProcessorToBridge.
@When("^create a fake Bridge \"([^\"]*)\"$")
public void addFakeProcessorToBridge(String testBridgeName) {
BridgeContext bridgeContext = context.newBridge(testBridgeName, Utils.generateId(testBridgeName), Utils.generateId("test-" + testBridgeName));
bridgeContext.setDeleted(true);
}
use of com.redhat.service.bridge.integration.tests.context.BridgeContext in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgeUtils method getOrRetrieveBridgeEndpoint.
public static String getOrRetrieveBridgeEndpoint(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();
}
use of com.redhat.service.bridge.integration.tests.context.BridgeContext in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorSteps method listOfBridgeInstancesIsFailingWithHTTPResponseCode.
@And("^the list of Processor instances of the Bridge \"([^\"]*)\" is failing with HTTP response code (\\d+)$")
public void listOfBridgeInstancesIsFailingWithHTTPResponseCode(String testBridgeName, int responseCode) {
BridgeContext bridgeContext = context.getBridge(testBridgeName);
ProcessorResource.getProcessorListResponse(context.getManagerToken(), bridgeContext.getId()).then().statusCode(responseCode);
}
Aggregations