use of io.syndesis.qe.endpoint.model.IntegrationOverview in project syndesis-qe by syndesisio.
the class CommonValidationSteps method verifyIntegrationState.
@Then("verify integration {string} has current state {string}")
public void verifyIntegrationState(String integrationName, String integrationState) {
String integrationId = integrationsEndpoint.getIntegrationId(integrationName).get();
integrationOverviewEndpoint = new IntegrationOverviewEndpoint();
final IntegrationOverview integrationOverview = integrationOverviewEndpoint.getOverview(integrationId);
log.debug("Actual state: {} and desired state: {}", integrationOverview.getCurrentState().name(), integrationState);
Assertions.assertThat(integrationOverview.getCurrentState().name()).isEqualTo(integrationState);
}
use of io.syndesis.qe.endpoint.model.IntegrationOverview in project syndesis-qe by syndesisio.
the class CommonValidationSteps method waitForIntegrationToBeActive.
@Then("wait max {int} minutes for integration with name: {string} to become active")
public void waitForIntegrationToBeActive(int waitTime, String integrationName) {
final long start = System.currentTimeMillis();
// wait for activation
log.info("Waiting until integration \"{}\" becomes active. This may take a while...", integrationName);
String integrationId = integrationsEndpoint.getIntegrationId(integrationName).get();
final IntegrationOverview integrationOverview = integrationOverviewEndpoint.getOverview(integrationId);
final boolean activated = TestUtils.waitForPublishing(integrationOverviewEndpoint, integrationOverview, TimeUnit.MINUTES, waitTime);
if (!activated) {
log.error("Integration was not active after {} minutes", waitTime);
final String podName = OpenShiftUtils.getPod(p -> p.getMetadata().getName().contains(integrationName.replaceAll(" ", "-").toLowerCase())).getMetadata().getName();
log.error(OpenShiftUtils.getInstance().pods().withName(podName).getLog());
InfraFail.fail("Integration was not active after " + waitTime + " minutes");
}
log.info("Integration pod has been started. It took {}s to build the integration.", TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - start));
if (TestUtils.isJenkins()) {
log.info("Running on Jenkins, adding 2 min sleep");
TestUtils.sleepIgnoreInterrupt(120000L);
}
}
use of io.syndesis.qe.endpoint.model.IntegrationOverview in project syndesis-qe by syndesisio.
the class CommonValidationSteps method verifyIntegrationNotStarted.
@Then("verify that the integration with name {string} is not started")
public void verifyIntegrationNotStarted(String integrationName) {
String integrationId = integrationsEndpoint.getIntegrationId(integrationName).get();
final IntegrationOverview integrationOverview = integrationOverviewEndpoint.getOverview(integrationId);
Assertions.assertThat(TestUtils.waitForPublishing(integrationOverviewEndpoint, integrationOverview, TimeUnit.MINUTES, 9)).as("No more integrations should be started").isFalse();
}
use of io.syndesis.qe.endpoint.model.IntegrationOverview in project syndesis-qe by syndesisio.
the class IntegrationsPublicApiSteps method checkState.
@Then("^check that state of the integration (\\w+) is (\\w+)$")
public void checkState(String integrationName, String desiredState) {
if ("Unpublished".equals(desiredState)) {
String integrationId = internalIntegrationsEndpoint.getIntegrationId(integrationName).get();
final IntegrationOverview integrationOverview = integrationOverviewEndpoint.getOverview(integrationId);
TestUtils.waitForUnpublishing(integrationOverviewEndpoint, integrationOverview, TimeUnit.MINUTES, 10);
}
assertThat(integrationsEndpoint.getStateOfIntegration(integrationName).get("currentState").asText()).isEqualTo(desiredState);
}
use of io.syndesis.qe.endpoint.model.IntegrationOverview in project syndesis-qe by syndesisio.
the class CommonValidationSteps method verifyWarningOnIntegration.
@Then("check that integration {word} contains warning {string}")
public void verifyWarningOnIntegration(String integrationName, String warning) {
IntegrationOverview overview = integrationOverviewEndpoint.getOverview(integrationsEndpoint.getIntegrationId(integrationName).get());
Assertions.assertThat(integrationOverviewEndpoint.getOverview(integrationsEndpoint.getIntegrationId(integrationName).get()).getBoard().getWarnings().getAsInt()).isGreaterThan(0);
Assertions.assertThat(overview.getBoard().getMessages().stream().filter(leveledMessage -> leveledMessage.getDetail().get().contains(warning)).findFirst()).isNotEmpty();
}
Aggregations