Created
December 26, 2024 16:37
-
-
Save borodicht/1119f2581924df66df420631b3d85e84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.restassured.http.ContentType; | |
import org.testng.annotations.Test; | |
import static io.restassured.RestAssured.given; | |
import static org.hamcrest.Matchers.equalTo; | |
public class PetStoreTest { | |
//Изолированные | |
//CRUD | |
@Test | |
public void checkCreatePetWithoutBody() { | |
given() | |
.log().all() | |
.contentType(ContentType.JSON) | |
.body("") | |
.when() | |
.post("https://petstore.swagger.io/v2/pet") | |
.then() | |
.log().all() | |
.statusCode(405) | |
.body("code", equalTo(405)) | |
.body("type", equalTo("unknown")) | |
.body("message", equalTo("no data")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment