Search in sources :

Example 6 with CurlOption

use of io.cucumber.core.options.CurlOption in project cucumber-jvm by cucumber.

the class UrlOutputStreamTest method throws_exception_for_500_status.

@Test
void throws_exception_for_500_status(Vertx vertx, VertxTestContext testContext) throws InterruptedException {
    String requestBody = "hello";
    TestServer testServer = new TestServer(port, testContext, requestBody, HttpMethod.PUT, null, null, 500, "Oh noes");
    CurlOption option = CurlOption.parse(format("http://localhost:%d/s3", port));
    verifyRequest(option, testServer, vertx, testContext, requestBody);
    assertThat(testContext.awaitCompletion(TIMEOUT_SECONDS, TimeUnit.SECONDS), is(true));
    assertThat(exception.getMessage(), equalTo("HTTP request failed:\n" + "> PUT http://localhost:" + port + "/s3\n" + "< HTTP/1.1 500 Internal Server Error\n" + "< transfer-encoding: chunked\n" + "Oh noes"));
}
Also used : CurlOption(io.cucumber.core.options.CurlOption) Test(org.junit.jupiter.api.Test)

Example 7 with CurlOption

use of io.cucumber.core.options.CurlOption in project cucumber-jvm by cucumber.

the class UrlOutputStreamTest method it_sends_the_body_twice_for_307_redirect_with_put.

@Test
void it_sends_the_body_twice_for_307_redirect_with_put(Vertx vertx, VertxTestContext testContext) throws Exception {
    String requestBody = "hello";
    TestServer testServer = new TestServer(port, testContext, requestBody + requestBody, HttpMethod.PUT, null, null, 200, "");
    CurlOption url = CurlOption.parse(format("http://localhost:%d/redirect", port));
    verifyRequest(url, testServer, vertx, testContext, requestBody);
    assertThat(testContext.awaitCompletion(TIMEOUT_SECONDS, TimeUnit.SECONDS), is(true));
}
Also used : CurlOption(io.cucumber.core.options.CurlOption) Test(org.junit.jupiter.api.Test)

Aggregations

CurlOption (io.cucumber.core.options.CurlOption)7 Test (org.junit.jupiter.api.Test)7 Disabled (org.junit.jupiter.api.Disabled)1