From a67028536edb243205240b91698872754fffdde0 Mon Sep 17 00:00:00 2001 From: Diana test Date: Sat, 23 Mar 2024 15:35:54 +0300 Subject: [PATCH] change echo --- build.gradle | 9 +++++++-- src/test/java/PostmanEchoTest.java | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/test/java/PostmanEchoTest.java diff --git a/build.gradle b/build.gradle index 990bf67..3bb60e5 100644 --- a/build.gradle +++ b/build.gradle @@ -5,15 +5,20 @@ plugins { group = 'ru.netology' version = '1.0-SNAPSHOT' +sourceCompatibility = 11 +compileJava.options.encoding = "UTF-8" +compileTestJava.options.encoding = "UTF-8" + repositories { mavenCentral() } dependencies { - testImplementation platform('org.junit:junit-bom:5.9.1') - testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'io.rest-assured:rest-assured:5.3.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0' } + test { useJUnitPlatform() } \ No newline at end of file diff --git a/src/test/java/PostmanEchoTest.java b/src/test/java/PostmanEchoTest.java new file mode 100644 index 0000000..fbd1ad9 --- /dev/null +++ b/src/test/java/PostmanEchoTest.java @@ -0,0 +1,23 @@ +import org.junit.jupiter.api.Test; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.equalTo; + +class PostmanEchoTest { + + @Test + void shouldReturnSendData() { + var text = "Hi"; + given() + .baseUri("https://postman-echo.com") + .body(text) + .when() + .post("/post") + .then() + .statusCode(200) + .body("data", equalTo(text)) + ; + } + + +}