use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class FhirValidationSteps method validateThatLastInsertPatientNameHasBeenChangedToInFHIR.
@Then("validate that last inserted patients name has been changed to {string} in FHIR")
public void validateThatLastInsertPatientNameHasBeenChangedToInFHIR(String newName) {
MyPatientSpecification newPs = splitName(newName);
newPs.setId(fhirUtils.getLastPatientId());
assertThat(fhirUtils.isPatientInFhir(newPs)).isTrue();
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class HTTPValidationSteps method verifyThatAfterSecondsWasCalls.
@Then("^verify that after (\\d+) seconds there (?:were|was) (\\d+) calls?$")
public void verifyThatAfterSecondsWasCalls(int seconds, int calls) {
clear();
TestUtils.sleepIgnoreInterrupt((long) seconds * 1000);
HTTPResponse r = HTTPUtils.doGetRequest("http://localhost:28080/events");
Map<Long, String> events = new Gson().fromJson(r.getBody(), Map.class);
assertThat(events).size().isEqualTo(calls);
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class BoxValidationSteps method verifyFileWithContentIsPresent.
@Then("verify that file {string} with content {string} is present in Box")
public void verifyFileWithContentIsPresent(String filename, String content) {
BoxFile f = boxUtils.getFile(filename);
Assertions.assertThat(f).isNotNull();
final String localFileName = "/tmp/" + UUID.randomUUID().toString();
try (FileOutputStream fos = new FileOutputStream(localFileName)) {
f.download(fos);
Assertions.assertThat(FileUtils.readFileToString(new File(localFileName), "UTF-8").trim()).isEqualTo(content);
} catch (IOException ex) {
fail("Unable to process file from Box: ", ex);
}
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class UpgradeSteps method checkPullSecret.
@Then("check that pull secret is linked in the service accounts")
public void checkPullSecret() {
boolean found = false;
// If it is present in the server, it was linked to all others needed
for (LocalObjectReference imagePullSecret : OpenShiftUtils.getInstance().getServiceAccount("syndesis-server").getImagePullSecrets()) {
if (imagePullSecret.getName().equals(TestConfiguration.syndesisPullSecretName())) {
found = true;
break;
}
}
assertThat(found).as("The pull secret should be linked to service account, but wasn't").isTrue();
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class CommonSteps method successNotificationIsPresentWithError.
@Then("^check visibility of \"([^\"]*)\" in alert-(\\w+) notification$")
public void successNotificationIsPresentWithError(String textMessage, String type) {
TestUtils.waitFor(() -> $$(Alert.getALERTS().get(type).getBy()).filterBy(Condition.matchesText(sanitizeSpecialCharacter(textMessage))).size() == 1, 2, 20, "Success notification not found!");
ElementsCollection successList = getAllAlerts(textMessage, type);
assertThat(successList).hasSize(1);
log.info("Text message {} was found.", textMessage);
}
Aggregations