use of io.syndesis.qe.utils.http.HTTPResponse in project syndesis-qe by syndesisio.
the class ODataSteps method resetODataV4Service.
@Then("^.*reset OData v4 service$")
public void resetODataV4Service() {
log.info("Reseting data on sample OData service");
HTTPResponse response = HTTPUtils.doPostRequest(ODataUtils.getV4OpenshiftRoute() + "Reset", "{}");
assertThat(response.getCode()).isEqualTo(204);
}
use of io.syndesis.qe.utils.http.HTTPResponse in project syndesis-qe by syndesisio.
the class TelegramSteps method checkLastMessageContains.
@Then("^check that telegram last message contains string \"([^\"]*)\"$")
public void checkLastMessageContains(String expectedText) {
HTTPResponse res = TelegramUtils.getUpdates();
Assertions.assertThat(res.getCode()).isEqualTo(200);
Assertions.assertThat(res.getBody()).containsIgnoringCase(expectedText);
}
use of io.syndesis.qe.utils.http.HTTPResponse in project syndesis-qe by syndesisio.
the class HTTPValidationSteps method verify.
private void verify(String method, boolean once) {
// Let the integration running
TestUtils.sleepIgnoreInterrupt(30000L);
// Get new events
HTTPResponse r = HTTPUtils.doGetRequest("http://localhost:28080/events");
Map<Long, String> events = new Gson().fromJson(r.getBody(), Map.class);
if (once) {
assertThat(events).size().isEqualTo(1);
} else {
assertThat(events).size().isGreaterThanOrEqualTo(5);
}
for (String event : events.values()) {
assertThat(method.equals(event));
}
}
use of io.syndesis.qe.utils.http.HTTPResponse in project syndesis-qe by syndesisio.
the class ServiceNow method updateIncident.
public static Incident updateIncident(String sysId, Incident incident) {
String json = getIncidentJson(incident);
log.debug(String.format("Sending incident Json: %s", json));
HTTPResponse r = HTTPUtils.doPutRequest(String.format("%s/%s", url, sysId), json, "application/json", Headers.of("Authorization", "Basic " + Base64.getEncoder().encodeToString((userName + ":" + password).getBytes())));
assertThat(r.getCode()).isEqualTo(200);
return getIncidentFromResponse(r);
}
Aggregations